Page 1 of 1

For new devs working on Doom3 or other C++ projects

Posted: Wed Jun 11, 2014 3:36 pm
by revelator
This was something i came across while changing C style casts to C++.

in some cases both static_cast and reinterpret_cast are treated by the compiler as valid, so heres a huge warning newer use reinterpret_cast in those cases, use static_cast.

reinterpret_cast changes the type casted to the type it is casted to and you are pretty much screwed if you modified a large source like Doom3 when it starts to act weird.
I just spent the last 8 hours reverting a huge chunk of code because of this :S.

Newer the less reinterpret_cast is sometimes nesseary like when casting *pointers to other *pointers static_cast will throw an error here but be carefull.

Re: For new devs working on Doom3 or other C++ projects

Posted: Wed Jun 11, 2014 5:59 pm
by revelator
wth ??? double posted it seems :shock: