For new devs working on Doom3 or other C++ projects
Moderator: InsideQC Admins
2 posts
• Page 1 of 1
For new devs working on Doom3 or other C++ projects
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.
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.
Productivity is a state of mind.
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
Re: For new devs working on Doom3 or other C++ projects
wth ??? double posted it seems 
Productivity is a state of mind.
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest