forked from scp-fs2open/fs2open.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Coding style
niffiwan edited this page Mar 15, 2016
·
5 revisions
Currently there is no universal coding style but if you change an existing file the existing style should be kept.
Currently only the C++ language features supported by Visual Studio 2010 are allowed because we still support Windows XP (that may change should MinGW support be added at some point) so for now the usage of C++11 features is limited. For a full list see the documentation provided by Microsoft but here is an incomplete list of what isn't supported:
enum class- range-based-for (foreach-loop)
- variadic templates
std::thread- Non-static data member initializers
RTTI may be used to dynamically query the type of an object at runtime
All new code should use a comparison with nullptr instead of NULL (or treating the pointer as a boolean); in other words, if (ptr != nullptr) is preferred to if (ptr != NULL) or if (ptr).