C++11 compatibility layer for old projects.
This will help you to port a C++98 project easily to C++11 and above.
#include <pseudo_cpp11.hpp>
Some are fake, some are functional, but all are direct compileable with --std=c++11
- explicit // (only fake)
- noexcept // (only functional on clang and gcc)
- override // (only fake)
- final // (only fake)
- nullptr
- constexpr
- DEFAULT as = default; // (only fake)
- DELETE as = delete; // (only fake)
- DEPRECATED as [[deprecated]]
- NORETURN as [[noreturn]] // (only functional on Visual Studio)
- NODISCARD as [[nodiscard]] // (only functional on clang and gcc)
- MAYBE_UNUSED as [[maybe_unused]] // (only functional on clang and gcc)
- UNUSED as (void) - not explicit C++11, but to compress compiler warnings until the project convertion is done.
foreach macro Visual Studio example:
foreach ( const int &_value, container ) {
std::cout << "Value: " << _value << std::endl;
}
Other example:
foreach ( _value, container ) {
std::cout << "Value: " << ( *_value ) << std::endl;
}
This helper is mostly for porting to C++11 and above, so this features will not work within this project:
- auto keyword
- using keyword
- initializer_list
- lambda functions
- variadic templates
- other specific C++11 features, not explicit listed here
Inside cmake/env.cmake you will find some user-defined build variables for particular purposes.
You can log the verbose build output.
# Debugging of build steps
set(CMAKE_VERBOSE_MAKEFILE ON)
You can build the example with C++11 and above standard.
# c++ standard - possible: 98, 11, 14, 17
set(CMAKE_CXX_STANDARD 11)
- from Microsoft Visual Studio 2008
- Clang >= 8 (Earlier not tested)
- GCC >= 7 (Earlier not tested)