|
cxxomfort
rel.20210622
Simple backports for C++ - http://ryan.gulix.cl/fossil.cgi/cxxomfort/
|
Code generation macros and utilities. More...
Macros | |
| #define | CXXO_DEFAULT_DEFAULT_CONSTRUCTOR(Type) Type () = default [or equivalent] |
Declares a “ =default ” default constructor. More... | |
| #define | CXXO_DEFAULT_COPY_CONSTRUCTOR(Type, Su, ...) |
Declares a =default copy constructor. More... | |
| #define | CXXO_TYPEOF(expr) __typeof__(expr) [or equivalent] |
Obtains the type of expr if there is a __typeof__-like facility to do so. More... | |
Code generation macros and utilities.
| #define CXXO_DEFAULT_DEFAULT_CONSTRUCTOR | ( | Type | ) | Type () = default [or equivalent] |
Declares a “ =default ” default constructor.
Using this macro in the body of a class will invoke, where available, the =default default constructor. In pre-C++11, it will invoke a throw() empty constructor.
| #define CXXO_DEFAULT_COPY_CONSTRUCTOR | ( | Type, | |
| Su, | |||
| ... | |||
| ) |
Declares a =default copy constructor.
| Su | constructor suffix (eg.: noexcept) |
| ... | Explicit constructor body (for C++03) |
Using this macro in the body of a class invokes, starting with C++11, a =default copy constructor. In C++03, it generates the code for a copy constructor using the subsequent arguments to the macro as code for the member initializer list, using the variable name From for the argument of the copy constructor.
| #define CXXO_TYPEOF | ( | expr | ) | __typeof__(expr) [or equivalent] |
Obtains the type of expr if there is a __typeof__-like facility to do so.
| expr | An expression evaluating to a type. Since this is a macro, it can't take commas. |
In C++11 onwards, this evaluates to decltype(expr) ; in other modes, it will ealuate to __typeof__(expr) if the feature is available or will error out if not.
Referenced by cxxomfort::cxxostd::bind_front(), and cxxomfort::cxxostd::invoke_r().
1.8.13