You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Eduardo Pinho edited this page Aug 25, 2017
·
3 revisions
Although we are dealing with old code, it doesn't mean we should aimlessly work our way into it. A few tips on programming for the OpenNotrium project are shown below.
C++11
Modern C++ development can make coding more efficient, simple and less dependent on third-party libraries. On the other hand, a few compilers are some steps behind on implementing the full specifications. Therefore, it is proposed that we only use the features of C++11 that are available on both GCC 4.8 and Visual Studio 2013. Here's a part of what we can use in OpenNotrium:
The auto keyword for variable type inference;
nullptr;
static_assert;
Initializer lists;
long long type (at least 64-bits in size);
Rvalue references (&&, used for holding expiring objects);
Scoped enums (enum class);
Lambdas;
Variadic templates;
Alias templates (with the using keyword to create template-compatible aliases);
Defaulted, deleted and delegated functions (constructors and destructors).
C++ Core Guidelines
When possible, refer to the official C++ Core Guidelines for additional guidance in new or refactored code.