Go to the source code of this file.
Classes | |
struct | auto_cast_trait< T > |
Macros | |
#define | ADD_AUTO_CAST(From, To) template <> struct auto_cast_trait<From> { using target_type = To; } |
helper macro to associate source and target types for auto-casting | |
#define | REGISTER_AUTO_CAST2(Type1, Type2) |
helper macro to associate two types mutually for auto-casting | |
#define | REGISTER_AUTO_CAST(Type) REGISTER_AUTO_CAST2( Type, MR_CONCAT( MR, Type ) ) |
#define | ARG(X) auto&& X = *auto_cast( MR_CONCAT( X, _ ) ) |
#define | ARG_PTR(X) auto&& X = auto_cast( MR_CONCAT( X, _ ) ) |
helper macro to cast a function argument from C pointer to C++ pointer | |
#define | ARG_VAL(X) auto&& X = auto_cast( MR_CONCAT( X, _ ) ) |
helper macro to cast a function argument from C pointer to C++ value | |
#define | ARG_OF(Type, X) auto&& X = *cast_to<Type>( MR_CONCAT( X, _ ) ) |
helper macro to cast a function argument from C pointer to C++ reference of specified type | |
#define | ARG_PTR_OF(Type, X) auto&& X = cast_to<Type>( MR_CONCAT( X, _ ) ) |
helper macro to cast a function argument from C pointer to C++ pointer of specified type | |
#define | ARG_VAL_OF(Type, X) auto&& X = cast_to<Type>( MR_CONCAT( X, _ ) ) |
helper macro to cast a function argument from C pointer to C++ value of specified type | |
#define | RETURN(...) return auto_cast( __VA_ARGS__ ) |
helper macro to auto-cast and return value | |
#define | RETURN_NEW(...) return auto_cast( new_from( __VA_ARGS__ ) ) |
helper function to allocate a new object of auto-detected type, auto-cast and return it | |
#define | RETURN_NEW_OF(Type, ...) return auto_cast( new_from<Type>( __VA_ARGS__ ) ) |
helper function to allocate a new object of specified type, auto-cast and return it | |
Functions | |
template<typename T , typename U > | |
auto | cast_to (U *from) |
helper functions to cast types without explicit qualifiers | |
template<typename T , typename U > | |
auto | cast_to (U &from) |
template<typename T , typename U > | |
auto | cast_to (U &&from) |
template<typename U > | |
auto | auto_cast (U &&from) |
helper function to cast to an associated type | |
template<typename T , typename U = std::remove_cvref_t<T>> | |
U * | new_from (T &&a) |
helper function to allocate a new object of auto-detected type | |
#define ADD_AUTO_CAST | ( | From, | |
To ) template <> struct auto_cast_trait<From> { using target_type = To; } |
helper macro to associate source and target types for auto-casting
helper macro to cast a function argument from C pointer to C++ reference of specified type
helper macro to cast a function argument from C pointer to C++ pointer
helper macro to cast a function argument from C pointer to C++ pointer of specified type
helper macro to cast a function argument from C pointer to C++ value
helper macro to cast a function argument from C pointer to C++ value of specified type
#define REGISTER_AUTO_CAST | ( | Type | ) | REGISTER_AUTO_CAST2( Type, MR_CONCAT( MR, Type ) ) |
#define REGISTER_AUTO_CAST2 | ( | Type1, | |
Type2 ) |
helper macro to associate two types mutually for auto-casting
#define RETURN | ( | ... | ) | return auto_cast( __VA_ARGS__ ) |
helper macro to auto-cast and return value
helper function to allocate a new object of auto-detected type, auto-cast and return it
helper function to allocate a new object of specified type, auto-cast and return it
|
inline |
helper function to cast to an associated type
|
inline |
|
inline |
|
inline |
helper functions to cast types without explicit qualifiers
|
inline |
helper function to allocate a new object of auto-detected type