jaulib v1.3.6
Jau Support Library (C++, Java, ..)
|
C++ language utilities, language feature alignment, type trails, data alignment and intrinsics. More...
Classes | |
class | jau::enums::enum_info< EnumType, Vargs > |
Enumeration info template class including iterator (enum_iterator) More... | |
class | jau::enums::enum_iterator< EnumType, Vargs > |
Enumeration iterator, see enum_info. More... | |
struct | jau::has_builtin_bit_cast_t< Dummy_type > |
Convenience type trait for __has_builtin(__builtin_bit_cast) . More... | |
struct | jau::has_member_of_pointer< C, typename > |
Checker for member of pointer '->' operator with convertible pointer return, no arguments. More... | |
struct | jau::has_member_of_pointer< C, typename std::enable_if_t< std::is_pointer_v< decltype(std::declval< C >().operator->())> > > |
struct | jau::is_container_memmove_compliant< class, class > |
template< class T > is_container_memmove_compliant<T>::value compile-time Type Trait, determining whether the given template class claims to be container memmove compliant, see @Ref darray_memmove. More... | |
struct | jau::is_container_memmove_compliant< T, std::void_t< typename T::container_memmove_compliant > > |
template< class T > is_container_memmove_compliant<T>::value compile-time Type Trait, determining whether the given template class claims to be container memmove compliant, see @Ref darray_memmove. More... | |
struct | jau::is_enforcing_secmem< class, class > |
template< class T > is_enforcing_secmem<T>::value compile-time Type Trait, determining whether the given template class enforces secmem, see @Ref darray_secmem. More... | |
struct | jau::is_enforcing_secmem< T, std::void_t< typename T::enforce_secmem > > |
template< class T > is_enforcing_secmem<T>::value compile-time Type Trait, determining whether the given template class enforces secmem, see @Ref darray_secmem. More... | |
struct | jau::enums::is_enum_info< class, class > |
template< class T > is_enum_info<T>::value compile-time Type Trait, determining whether the given template class is a enum_info type. More... | |
struct | jau::enums::is_enum_info< T, std::void_t< typename T::enum_info_tag > > |
template< class T > is_enum_info<T>::value compile-time Type Trait, determining whether the given template class is a enum_info type. More... | |
struct | jau::is_rtti_available_t< _Dummy > |
Template type trait evaluating std::true_type{} if RTTI is available, otherwise std::false_type{}. More... | |
struct | jau::enums::NameTable< Vargs > |
struct | jau::packed_t< T > |
Support aligned memory transfer from and to potentially unaligned memory. More... | |
struct | jau::type_cue< T > |
Helper, allowing simple access to compile time typename and Type traits information, see jau::type_name_cue to setup typename's string representation. More... | |
class | jau::type_info |
Generic type information using either Runtime type information (RTTI) or Compile time type information (CTTI) More... | |
struct | jau::type_name_cue< T > |
Helper, allowing simple access and provision of a typename string representation at compile time, see jau::type_cue for usage. More... | |
struct | jau::enums::ValueTable< E, N > |
Macros | |
#define | __attrdecl_no_optimize__ |
#define | __attrdef_no_optimize__ |
#define | __packed __attribute__ ((packed)) |
packed: lead out macro, requires packed lead in as well. | |
#define | __restrict_cxx__ |
Wrap C++ extension __restrict__ covering C99's restrict feature keyword. | |
#define | consteval_cxx20 constexpr |
consteval qualifier replacement for C++20 consteval . | |
#define | constexpr_atomic constexpr_cxx23 |
Used when designed to declare a function constexpr , but prohibited by its specific implementation. | |
#define | constexpr_cxx20 inline |
constexpr qualifier replacement for C++20 constexpr . | |
#define | constexpr_cxx23 inline |
#define | constexpr_cxx26 inline |
#define | constexpr_non_literal_var constexpr_cxx23 |
Used when designed to declare a function constexpr , but prohibited by its specific implementation. | |
#define | constinit_cxx20 constexpr |
constinit qualifier replacement for C++20 constinit . | |
#define | final_opt final |
Optional generic usage of final keyword w/o negative performance impact. | |
#define | JAU_APPEND_BITSTR(U, V, M) |
#define | JAU_ENUM_CASE_LONG(type, name) |
#define | JAU_ENUM_CASE_SHORT(type, name) |
#define | JAU_ENUM_TYPE_VALUE(type, name) |
#define | JAU_ENUM_VALUE(type, name) |
#define | JAU_EXPAND(...) |
#define | JAU_EXPAND1(...) |
#define | JAU_EXPAND2(...) |
#define | JAU_EXPAND3(...) |
#define | JAU_EXPAND4(...) |
#define | JAU_FOR_EACH(macro, type, ...) |
#define | JAU_FOR_EACH_AGAIN() |
#define | JAU_FOR_EACH_HELPER(macro, type, a1, ...) |
#define | JAU_FOR_EACH_LIST(macro, type, ...) |
#define | JAU_FOR_EACH_LIST_AGAIN() |
#define | JAU_FOR_EACH_LIST_HELPER(macro, type, a1, ...) |
#define | JAU_FOR_EACH_VALUE(macro, type, value, ...) |
#define | JAU_FOR_EACH_VALUE_AGAIN() |
#define | JAU_FOR_EACH_VALUE_HELPER(macro, type, value, a1, ...) |
#define | JAU_MAKE_BITFIELD_ENUM_STRING(type, ...) |
#define | JAU_MAKE_BITFIELD_ENUM_STRING2(type, stype, ...) |
#define | JAU_MAKE_ENUM_INFO(type, ...) |
#define | JAU_MAKE_ENUM_INFO2(type, stype, ...) |
#define | JAU_MAKE_ENUM_STRING(type, ...) |
#define | JAU_MAKE_ENUM_STRING_SUB(type, stype, ...) |
#define | JAU_PARENS () |
#define | JAU_TYPENAME_CUE(A) |
#define | JAU_TYPENAME_CUE_ALL(A) |
#define | METHOD_CHECKER(checker, name, ret, args) |
Checker for member function with convertible return type and accepting given arguments. | |
#define | METHOD_CHECKER_ANY(name, fn, args) |
Checker for member function accepting given arguments. | |
#define | METHOD_CHECKER_STRICT_RET(name, fn, ret, args) |
Checker for member function with exact retutn type and accepting given arguments. | |
#define | MTYPE_CHECKER(checker, name) |
Checker for member with given name and convertible type. | |
#define | MTYPE_CHECKER_ANY(checker, name) |
Checker for member with given name and any type. | |
#define | MTYPE_CHECKER_STRICT(checker, name) |
Checker for member with given name and exact type. | |
#define | packed__ |
packed__: lead in macro, requires __packed lead out as well. | |
#define | PRAGMA_DISABLE_WARNING_CPP |
#define | PRAGMA_DISABLE_WARNING_FORMAT_NONLITERAL |
#define | PRAGMA_DISABLE_WARNING_FORMAT_OVERFLOW |
#define | PRAGMA_DISABLE_WARNING_INT_OVERFLOW |
#define | PRAGMA_DISABLE_WARNING_MULTICHAR |
#define | PRAGMA_DISABLE_WARNING_NULL_DEREFERENCE |
#define | PRAGMA_DISABLE_WARNING_PEDANTIC |
#define | PRAGMA_DISABLE_WARNING_PMF_CONVERSIONS |
#define | PRAGMA_DISABLE_WARNING_POP |
#define | PRAGMA_DISABLE_WARNING_PUSH |
#define | PRAGMA_DISABLE_WARNING_RESTRICT |
#define | PRAGMA_DISABLE_WARNING_STRINGOP_OVERFLOW |
#define | PRAGMA_DISABLE_WARNING_UNREFERENCED_FORMAL_PARAMETER |
#define | PRAGMA_DISABLE_WARNING_UNREFERENCED_FUNCTION |
#define | PRAGMA_DISABLE_WARNING_ZERO_LENGTH_ARRAY |
Typedefs | |
template<typename... Ts> | |
using | jau::first_type = std::tuple_element_t<0, std::tuple<Ts...>> |
template<typename... Ts> | |
using | jau::is_all_same = std::conjunction<std::is_same<first_type<Ts...>, Ts>...> |
Enumerations | |
enum class | jau::Bool : bool { jau::Bool::False = false , jau::Bool::True = true } |
Boolean type without implicit conversion, safe for function parameter. More... | |
enum class | jau::type_info_flags_t : uint16_t { jau::type_info_flags_t::none = 0 , jau::type_info_flags_t::obj = 1 << 0 , jau::type_info_flags_t::sig = 1 << 1 } |
enum class | jau::TypeTraitGroup : uint8_t { jau::TypeTraitGroup::NONE = 0b00000000 , jau::TypeTraitGroup::PRIMARY_TYPE_CAT = 0b00000001 , jau::TypeTraitGroup::TYPE_PROPERTIES = 0b00000010 , jau::TypeTraitGroup::COMPOSITE_TYPE_CAT = 0b00000100 , jau::TypeTraitGroup::SUPPORTED_OPERATIONS = 0b00001000 , jau::TypeTraitGroup::ALL = 0b11111111 } |
Enumerating the different groups of type traits. More... | |
Functions | |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr void | jau::enums::append_bitstr (std::string &out, E mask, E bit, const std::string &bitstr, bool &comma) |
template<class Dest, class Source> | |
constexpr std::enable_if_t< sizeof(Dest)==sizeof(Source) &&std::is_trivially_copyable_v< Dest > &&std::is_trivially_copyable_v< Source >, Dest > | jau::bit_cast (const Source &src) noexcept |
C++20 bit_cast<>(arg) implementation for C++17. | |
template<typename UnaryFunc> | |
void | jau::callNotOptimize (UnaryFunc f) __attrdef_no_optimize__ |
Simple unary function wrapper which ensures function call to happen in order and not optimized away. | |
template<typename T> | |
constexpr const char * | jau::ctti_name () noexcept |
Returns the type name of given type T using template Compile Time Type Information (CTTI) only with static constant storage duration. | |
template<typename R, typename L, typename... A> | |
constexpr const char * | jau::ctti_name () noexcept |
Returns the type name of given function types R(*L)(A...) using template Compile Time Type Information (CTTI) only with static constant storage duration. | |
std::string | jau::demangle_name (const char *mangled_name) noexcept |
Returns the demangled given mangled_name if successful, otherwise the mangled_name. | |
template<typename E, E V> | |
consteval_cxx20 const char * | jau::enums::enum_funcname () noexcept |
clang + gcc | |
constexpr Bool | jau::False () noexcept |
template<auto... Vargs> | |
consteval_cxx20 NameTable< Vargs... > | jau::enums::get_names () noexcept |
template<typename... Args> | |
constexpr ValueTable< std::common_type_t< Args... >, sizeof...(Args)> | jau::enums::get_values (Args... args) noexcept |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr bool | jau::enums::has_any (const E mask, const E bits) noexcept |
consteval_cxx20 bool | jau::has_builtin_bit_cast () noexcept |
Query whether __builtin_bit_cast(Dest_type, arg) is available via __has_builtin(__builtin_bit_cast) . | |
consteval_cxx20 bool | jau::is_builtin_int128_available () noexcept |
consteval_cxx20 bool | jau::is_cxx17 () noexcept |
Returns true if compiled with >= C++17. | |
consteval_cxx20 bool | jau::is_cxx20 () noexcept |
Returns true if compiled with >= C++20. | |
consteval_cxx20 bool | jau::is_cxx23 () noexcept |
Returns true if compiled with >= C++23. | |
consteval_cxx20 bool | jau::is_cxx26 () noexcept |
Returns true if compiled with >= C++26. | |
consteval_cxx20 bool | jau::is_debug_enabled () noexcept |
Returns true if compiled with debug information and w/o optimization, i.e. | |
template<auto V, std::enable_if_t< std::is_enum_v< decltype(V)> > * = nullptr> | |
consteval_cxx20 bool | jau::enums::is_enum () noexcept |
consteval_cxx20 bool | jau::is_rtti_available () noexcept |
Returns true if compiled with RTTI available. | |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr bool | jau::enums::is_set (const E mask, const E bits) noexcept |
constexpr bool | jau::isTypeTraitBitSet (const TypeTraitGroup mask, const TypeTraitGroup bit) noexcept |
jau::JAU_MAKE_BITFIELD_ENUM_STRING (type_info_flags_t, obj, sig) | |
template<auto V, std::enable_if_t< std::is_enum_v< decltype(V)> > * = nullptr> | |
consteval_cxx20 std::string_view | jau::enums::long_name () noexcept |
template<typename T> | |
jau::type_info | jau::make_ctti (bool identity_instance=false) noexcept |
Constructs a jau::type_info instance based on given type T using template Compile Time Type Information (CTTI) only. | |
template<typename R, typename L, typename... A> | |
jau::type_info | jau::make_ctti (bool identity_instance=false) noexcept |
Constructs a jau::type_info instance based on given function types R(*L)(A...) using template Compile Time Type Information (CTTI) only via RTTI's `typeid(L) if available or jau::ctti_name<R, L, A...>() otherwise. | |
template<auto V, std::enable_if_t< std::is_enum_v< decltype(V)> > * = nullptr> | |
consteval_cxx20 std::string_view | jau::enums::name () noexcept |
constexpr std::string_view | jau::name (const Bool v) noexcept |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr std::underlying_type_t< E > | jau::enums::number (const E v) noexcept |
constexpr uint8_t | jau::number (const TypeTraitGroup rhs) noexcept |
constexpr Bool | jau::operator! (const Bool rhs) noexcept |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr bool | jau::enums::operator!= (const E lhs, const E rhs) noexcept |
constexpr bool | jau::operator!= (const TypeTraitGroup lhs, const TypeTraitGroup rhs) noexcept |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr E | jau::enums::operator& (const E lhs, const E rhs) noexcept |
constexpr Bool | jau::operator& (const Bool lhs, const Bool rhs) noexcept |
constexpr TypeTraitGroup | jau::operator& (const TypeTraitGroup lhs, const TypeTraitGroup rhs) noexcept |
constexpr Bool | jau::operator&& (const Bool lhs, const Bool rhs) noexcept |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr E & | jau::enums::operator&= (E &lhs, const E rhs) noexcept |
constexpr Bool & | jau::operator&= (Bool &lhs, const Bool rhs) noexcept |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr std::underlying_type_t< E > | jau::enums::operator* (const E v) noexcept |
constexpr bool | jau::operator* (const Bool rhs) noexcept |
template<typename enum_info_t, std::enable_if_t< is_enum_info< enum_info_t >::value > * = nullptr> | |
std::ostream & | jau::enums::operator<< (std::ostream &os, const enum_info_t &v) |
template<typename T, std::enable_if_t< std::is_enum_v< T > > * = nullptr> | |
std::ostream & | jau::enums::operator<< (std::ostream &os, const T v) |
std::ostream & | jau::operator<< (std::ostream &out, const Bool c) |
std::ostream & | jau::operator<< (std::ostream &out, const type_info &v) |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr bool | jau::enums::operator== (const E lhs, const E rhs) noexcept |
constexpr bool | jau::operator== (const Bool lhs, const Bool rhs) noexcept |
constexpr bool | jau::operator== (const TypeTraitGroup lhs, const TypeTraitGroup rhs) noexcept |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr E | jau::enums::operator^ (const E lhs, const E rhs) noexcept |
constexpr Bool | jau::operator^ (const Bool lhs, const Bool rhs) noexcept |
constexpr TypeTraitGroup | jau::operator^ (const TypeTraitGroup lhs, const TypeTraitGroup rhs) noexcept |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr E & | jau::enums::operator^= (E &lhs, const E rhs) noexcept |
constexpr Bool & | jau::operator^= (Bool &lhs, const Bool rhs) noexcept |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr E | jau::enums::operator| (const E lhs, const E rhs) noexcept |
constexpr Bool | jau::operator| (const Bool lhs, const Bool rhs) noexcept |
constexpr TypeTraitGroup | jau::operator| (const TypeTraitGroup lhs, const TypeTraitGroup rhs) noexcept |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr E & | jau::enums::operator|= (E &lhs, const E rhs) noexcept |
constexpr Bool & | jau::operator|= (Bool &lhs, const Bool rhs) noexcept |
constexpr Bool | jau::operator|| (const Bool lhs, const Bool rhs) noexcept |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr E | jau::enums::operator~ (const E rhs) noexcept |
template<class Dest, class Source> | |
constexpr std::enable_if_t< sizeof(Dest)==sizeof(Source) &&std::is_pointer_v< Source > &&std::is_pointer_v< Dest >, Dest > | jau::pointer_cast (const Source &src) noexcept |
A constexpr pointer cast implementation for C++17, inspired by C++20 bit_cast<>(arg) . | |
template<typename T> | |
const jau::type_info & | jau::static_ctti () noexcept |
Returns a static global reference of make_ctti<T>(true) w/ identity instance. | |
template<typename R, typename L, typename... A> | |
const jau::type_info & | jau::static_ctti () noexcept |
Returns a static global reference of make_ctti<R, L, A...>(true) w/ identity instance. | |
constexpr std::string | jau::to_string (const Bool v) noexcept |
constexpr Bool | jau::True () noexcept |
template<typename T> | |
const char * | jau::type_name () noexcept |
Returns the type name of given type T using template Compile Time Type Information (CTTI) only via RTTI's typeid(T).name() if available or jau::ctti_name<T>() otherwise. | |
template<typename R, typename L, typename... A> | |
const char * | jau::type_name () noexcept |
Returns the type name of given function types R(*L)(A...) using template Compile Time Type Information (CTTI) only via RTTI's typeid(L).name() if available or jau::ctti_name<R, L, A...>() otherwise. | |
constexpr bool | jau::value (const Bool rhs) noexcept |
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr> | |
constexpr E & | jau::enums::write (E &store, const E bits, bool set) noexcept |
If set==true , sets the bits in store , i.e. | |
Variables | |
template<typename Dummy_type> | |
constexpr bool | jau::has_builtin_bit_cast_v = has_builtin_bit_cast_t<Dummy_type>::value |
Value access of has_builtin_bit_cast type trait for convenience . | |
template<typename _Tp> | |
constexpr bool | jau::has_member_of_pointer_v = has_member_of_pointer<_Tp>::value |
template<typename _Tp> | |
constexpr bool | jau::has_to_string_v = has_to_string<_Tp>::value |
template<typename _Tp> | |
constexpr bool | jau::has_toString_v = has_toString<_Tp>::value |
template<typename... Ts> | |
constexpr bool | jau::is_all_same_v = is_all_same<Ts...>::value |
template<typename T> | |
constexpr bool | jau::is_container_memmove_compliant_v = is_container_memmove_compliant<T>::value |
template<typename T> | |
constexpr bool | jau::is_enforcing_secmem_v = is_enforcing_secmem<T>::value |
template<typename _Dummy> | |
constexpr bool | jau::is_rtti_available_v = is_rtti_available_t<_Dummy>::value |
Template type trait helper evaluating true if RTTI is available, otherwise false. | |
C++ language utilities, language feature alignment, type trails, data alignment and intrinsics.
Used predefined __cplusplus
macro identifier for C++ language specs:
199711L
: pre C++11201103L
: C++11201402L
: C++14201703L
: C++17202002L
: C++20202302L
: C++23??????L
: C++26 ??Used predefined macros denoting the compiler:
__clang__
: LLVM's clang, clang++__GNUC__
: GNU Compiler Collection (GCC)'s gcc, g++_MSC_VER
: Microsoft Compiler__MINGW32__
: MinGW 32__MINGW64__
: MinGW 64__EMSCRIPTEN__
: emscripten for asm.js and WebAssemblyFurther infos:
#define consteval_cxx20 constexpr |
consteval
qualifier replacement for C++20 consteval
.
A
consteval
specifier impliesinline
. At most one of theconstexpr
,consteval
, andconstinit
specifiers is allowed to appear within the same sequence of declaration specifiers. ... An immediate function is aconstexpr
function, and must satisfy the requirements applicable toconstexpr
functions orconstexpr
constructors, as the case may be.
Evaluated using the alternative qualifier constexpr
for C++ < 20, as it is almost contained within consteval
but lacks the immediate function
constraint.
Evaluated as consteval
for C++20.
Definition at line 85 of file cpp_lang_util.hpp.
#define constinit_cxx20 constexpr |
constinit
qualifier replacement for C++20 constinit
.
constinit
cannot be used together withconstexpr
orconsteval
. When the declared variable is a reference,constinit
is equivalent toconstexpr
. When the declared variable is an object,constexpr
mandates that the object must have static initialization and constant destruction and makes the object const-qualified, however,constinit
does not mandate constant destruction and const-qualification.
Evaluated using the alternative qualifier constexpr
for C++ < 20, as it is almost contained within constinit
but lacks the loosening of not mandating constant destruction and const-qualification.
FIXME: Due to the above, this replacement might not be suitable: TBD!
Evaluated as constinit
for C++20.
Definition at line 142 of file cpp_lang_util.hpp.
#define constexpr_cxx20 inline |
constexpr
qualifier replacement for C++20 constexpr
.
A
constexpr
specifier used in a function or static member variable (since C++17) declaration impliesinline
.
Evaluated using the alternative qualifier inline
for C++ < 20, as it is implied for constexpr
functions or static member variables, see above.
Evaluated as constexpr
for C++20, i.e. std::string literals, virtual functions, etc.
Definition at line 161 of file cpp_lang_util.hpp.
#define constexpr_cxx23 inline |
Definition at line 167 of file cpp_lang_util.hpp.
#define constexpr_cxx26 inline |
Definition at line 173 of file cpp_lang_util.hpp.
#define constexpr_non_literal_var constexpr_cxx23 |
Used when designed to declare a function constexpr
, but prohibited by its specific implementation.
Evaluated using the alternative qualifier inline
for C++ < 23, as it is implied for constexpr
functions or static member variables, see constexpr_cxx23.
Here it but uses non-literal variables, such as std::lock_guard etc. As these can't be evaluated at compile time, the standard does not allow using constexpr
here.
Empty until standard defines otherwise.
Definition at line 194 of file cpp_lang_util.hpp.
#define constexpr_atomic constexpr_cxx23 |
Used when designed to declare a function constexpr
, but prohibited by its specific implementation.
Evaluated using the alternative qualifier inline
for C++ < 23, as it is implied for constexpr
functions or static member variables, see constexpr_cxx23.
Here it uses thread-safety related measures like atomic storage or mutex locks, which are non-literal variables and hence prohibit the use of constexpr
.
Definition at line 211 of file cpp_lang_util.hpp.
#define __restrict_cxx__ |
Wrap C++ extension __restrict__
covering C99's restrict
feature keyword.
Definition at line 223 of file cpp_lang_util.hpp.
#define final_opt final |
Optional generic usage of final keyword w/o negative performance impact.
(Enabled, OK?)
Definition at line 269 of file cpp_lang_util.hpp.
#define __attrdecl_no_optimize__ |
Definition at line 431 of file cpp_lang_util.hpp.
#define __attrdef_no_optimize__ |
Definition at line 432 of file cpp_lang_util.hpp.
#define PRAGMA_DISABLE_WARNING_PUSH |
Definition at line 85 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_POP |
Definition at line 86 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_UNREFERENCED_FORMAL_PARAMETER |
Definition at line 87 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_UNREFERENCED_FUNCTION |
Definition at line 88 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_CPP |
Definition at line 89 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_MULTICHAR |
Definition at line 90 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_NULL_DEREFERENCE |
Definition at line 91 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_FORMAT_OVERFLOW |
Definition at line 92 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_FORMAT_NONLITERAL |
Definition at line 93 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_PMF_CONVERSIONS |
Definition at line 94 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_STRINGOP_OVERFLOW |
Definition at line 95 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_INT_OVERFLOW |
Definition at line 96 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_RESTRICT |
Definition at line 97 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_PEDANTIC |
Definition at line 98 of file cpp_pragma.hpp.
#define PRAGMA_DISABLE_WARNING_ZERO_LENGTH_ARRAY |
Definition at line 99 of file cpp_pragma.hpp.
#define JAU_PARENS () |
Definition at line 576 of file enum_util.hpp.
#define JAU_EXPAND | ( | ... | ) |
Definition at line 578 of file enum_util.hpp.
#define JAU_EXPAND4 | ( | ... | ) |
Definition at line 579 of file enum_util.hpp.
#define JAU_EXPAND3 | ( | ... | ) |
Definition at line 580 of file enum_util.hpp.
#define JAU_EXPAND2 | ( | ... | ) |
Definition at line 581 of file enum_util.hpp.
#define JAU_EXPAND1 | ( | ... | ) |
Definition at line 582 of file enum_util.hpp.
#define JAU_FOR_EACH | ( | macro, | |
type, | |||
... ) |
Definition at line 584 of file enum_util.hpp.
#define JAU_FOR_EACH_HELPER | ( | macro, | |
type, | |||
a1, | |||
... ) |
Definition at line 586 of file enum_util.hpp.
#define JAU_FOR_EACH_AGAIN | ( | ) |
Definition at line 589 of file enum_util.hpp.
#define JAU_ENUM_CASE_SHORT | ( | type, | |
name ) |
Definition at line 591 of file enum_util.hpp.
#define JAU_ENUM_CASE_LONG | ( | type, | |
name ) |
Definition at line 592 of file enum_util.hpp.
#define JAU_FOR_EACH_LIST | ( | macro, | |
type, | |||
... ) |
Definition at line 594 of file enum_util.hpp.
#define JAU_FOR_EACH_LIST_HELPER | ( | macro, | |
type, | |||
a1, | |||
... ) |
Definition at line 596 of file enum_util.hpp.
#define JAU_FOR_EACH_LIST_AGAIN | ( | ) |
Definition at line 599 of file enum_util.hpp.
#define JAU_ENUM_TYPE_VALUE | ( | type, | |
name ) |
Definition at line 601 of file enum_util.hpp.
#define JAU_ENUM_VALUE | ( | type, | |
name ) |
Definition at line 602 of file enum_util.hpp.
#define JAU_FOR_EACH_VALUE | ( | macro, | |
type, | |||
value, | |||
... ) |
Definition at line 604 of file enum_util.hpp.
#define JAU_FOR_EACH_VALUE_HELPER | ( | macro, | |
type, | |||
value, | |||
a1, | |||
... ) |
Definition at line 606 of file enum_util.hpp.
#define JAU_FOR_EACH_VALUE_AGAIN | ( | ) |
Definition at line 609 of file enum_util.hpp.
#define JAU_MAKE_ENUM_STRING | ( | type, | |
... ) |
Definition at line 611 of file enum_util.hpp.
#define JAU_APPEND_BITSTR | ( | U, | |
V, | |||
M ) |
Definition at line 618 of file enum_util.hpp.
#define JAU_MAKE_BITFIELD_ENUM_STRING | ( | type, | |
... ) |
Definition at line 620 of file enum_util.hpp.
#define JAU_MAKE_BITFIELD_ENUM_STRING2 | ( | type, | |
stype, | |||
... ) |
Definition at line 632 of file enum_util.hpp.
#define JAU_MAKE_ENUM_STRING_SUB | ( | type, | |
stype, | |||
... ) |
Definition at line 645 of file enum_util.hpp.
#define JAU_MAKE_ENUM_INFO | ( | type, | |
... ) |
Definition at line 670 of file enum_util.hpp.
#define JAU_MAKE_ENUM_INFO2 | ( | type, | |
stype, | |||
... ) |
Definition at line 673 of file enum_util.hpp.
#define packed__ |
packed__: lead in macro, requires __packed lead out as well.
Consider using __pack(...).
Definition at line 39 of file packed_attribute.hpp.
#define __packed __attribute__ ((packed)) |
packed: lead out macro, requires packed lead in as well.
Consider using __pack(...).
Definition at line 48 of file packed_attribute.hpp.
#define JAU_TYPENAME_CUE | ( | A | ) |
Definition at line 249 of file type_traits_queries.hpp.
#define JAU_TYPENAME_CUE_ALL | ( | A | ) |
Definition at line 250 of file type_traits_queries.hpp.
#define MTYPE_CHECKER | ( | checker, | |
name ) |
Checker for member with given name and convertible type.
Definition at line 341 of file type_traits_queries.hpp.
#define MTYPE_CHECKER_STRICT | ( | checker, | |
name ) |
Checker for member with given name and exact type.
Definition at line 347 of file type_traits_queries.hpp.
#define MTYPE_CHECKER_ANY | ( | checker, | |
name ) |
Checker for member with given name and any type.
Definition at line 353 of file type_traits_queries.hpp.
#define METHOD_CHECKER | ( | checker, | |
name, | |||
ret, | |||
args ) |
Checker for member function with convertible return type and accepting given arguments.
Definition at line 359 of file type_traits_queries.hpp.
#define METHOD_CHECKER_STRICT_RET | ( | name, | |
fn, | |||
ret, | |||
args ) |
Checker for member function with exact retutn type and accepting given arguments.
Definition at line 365 of file type_traits_queries.hpp.
#define METHOD_CHECKER_ANY | ( | name, | |
fn, | |||
args ) |
Checker for member function accepting given arguments.
Definition at line 371 of file type_traits_queries.hpp.
using jau::first_type = std::tuple_element_t<0, std::tuple<Ts...>> |
Definition at line 293 of file type_traits_queries.hpp.
using jau::is_all_same = std::conjunction<std::is_same<first_type<Ts...>, Ts>...> |
Definition at line 296 of file type_traits_queries.hpp.
|
strong |
Boolean type without implicit conversion, safe for function parameter.
Enumerator | |
---|---|
False | |
True |
Definition at line 446 of file cpp_lang_util.hpp.
|
strong |
Enumerator | |
---|---|
none | |
obj | |
sig |
Definition at line 154 of file type_info.hpp.
|
strong |
Enumerating the different groups of type traits.
Enumerator | |
---|---|
NONE | NONE. |
PRIMARY_TYPE_CAT | PRIMARY_TYPE_CAT. |
TYPE_PROPERTIES | TYPE_PROPERTIES. |
COMPOSITE_TYPE_CAT | COMPOSITE_TYPE_CAT. |
SUPPORTED_OPERATIONS | SUPPORTED_OPERATIONS. |
ALL | ALL. |
Definition at line 53 of file type_traits_queries.hpp.
|
noexcept |
Returns true if compiled with >= C++17.
Definition at line 89 of file cpp_lang_util.hpp.
|
noexcept |
Returns true if compiled with >= C++20.
Definition at line 97 of file cpp_lang_util.hpp.
|
noexcept |
Returns true if compiled with >= C++23.
Definition at line 105 of file cpp_lang_util.hpp.
|
noexcept |
Returns true if compiled with >= C++26.
Definition at line 113 of file cpp_lang_util.hpp.
|
noexcept |
Returns the demangled given mangled_name if successful, otherwise the mangled_name.
Implementation utilizes the cross-vendor C++ ABI abi::__cxa_demangle() as supported at least on on gcc
and clang
.
May be used to demangle the result of jau::type_name() or jau::type_info::name() if jau::type_info::rtti_available == true, i.e. RTTI typeif(T) symbols are being used.
See also gcc libstdc++ FAQ, Chapter 28.
Further, implementation also checks whether the mangled_name results from jau::ctti_name<T>() and cleans up the known gcc
and clang
variant of JAU_PRETTY_FUNCTION.
mangled_name | mangled name |
Definition at line 57 of file debug.cpp.
|
noexcept |
Query whether __builtin_bit_cast(Dest_type, arg)
is available via __has_builtin(__builtin_bit_cast)
.
Availability of __builtin_bit_cast(Dest_type, arg)
Reflecting my manual platform tests using test_basictypeconv.cpp
Compiler | Version | Architecture | Available |
---|---|---|---|
GCC | 8.3.0 | amd64, arm64, arm32 | no |
GCC | 10.2.1 | amd64 | no |
GCC | 12.2.0 | amd64 | yes |
clang | 9.0.1 | amd64, arm64 | yes |
clang | 11.0.1 | amd64 | yes |
true
if query subject is available, otherwise not. Definition at line 323 of file cpp_lang_util.hpp.
|
constexprnoexcept |
A constexpr
pointer cast implementation for C++17, inspired by C++20 bit_cast<>(arg)
.
If is_builtin_bit_cast_available() evaluates true
, implementation uses __builtin_bit_cast(Dest, src)
.
Otherwise a simple reinterpret_cast<Dest>(src)
is utilized, which officially is questionable to deliver a constexpr
.
Dest | the target pointer type |
Source | the source pointer argument type |
src | the pointer to convert to Dest pointer type |
Definition at line 356 of file cpp_lang_util.hpp.
|
constexprnoexcept |
C++20 bit_cast<>(arg)
implementation for C++17.
Utilizing native bit_cast if is_builtin_bit_cast_available(), otherwise pointer_cast<const packed_t<Dest>*>( &src )->store
.
Dest | the target type |
Source | the source argument type |
src | the value to convert to Dest type |
Definition at line 386 of file cpp_lang_util.hpp.
|
noexcept |
|
noexcept |
Returns true if compiled with debug information and w/o optimization, i.e.
not defined(NDEBUG) && !defined(DEBUG)
.
Definition at line 415 of file cpp_lang_util.hpp.
|
inline |
Simple unary function wrapper which ensures function call to happen in order and not optimized away.
Definition at line 439 of file cpp_lang_util.hpp.
|
constexprnoexcept |
|
constexprnoexcept |
|
constexprnoexcept |
|
constexprnoexcept |
Definition at line 456 of file cpp_lang_util.hpp.
Definition at line 459 of file cpp_lang_util.hpp.
Definition at line 462 of file cpp_lang_util.hpp.
Definition at line 465 of file cpp_lang_util.hpp.
Definition at line 468 of file cpp_lang_util.hpp.
Definition at line 471 of file cpp_lang_util.hpp.
Definition at line 474 of file cpp_lang_util.hpp.
Definition at line 477 of file cpp_lang_util.hpp.
Definition at line 481 of file cpp_lang_util.hpp.
Definition at line 485 of file cpp_lang_util.hpp.
Definition at line 489 of file cpp_lang_util.hpp.
|
constexprnoexcept |
|
constexprnoexcept |
Definition at line 499 of file cpp_lang_util.hpp.
|
inline |
Definition at line 500 of file cpp_lang_util.hpp.
|
noexcept |
clang + gcc
Definition at line 77 of file enum_util.hpp.
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
constexprnoexcept |
|
constexprnoexcept |
|
constexprnoexcept |
Definition at line 170 of file enum_util.hpp.
|
constexprnoexcept |
Definition at line 173 of file enum_util.hpp.
|
constexprnoexcept |
Definition at line 178 of file enum_util.hpp.
|
constexprnoexcept |
Definition at line 183 of file enum_util.hpp.
|
constexprnoexcept |
Definition at line 188 of file enum_util.hpp.
|
constexprnoexcept |
Definition at line 193 of file enum_util.hpp.
|
constexprnoexcept |
Definition at line 198 of file enum_util.hpp.
|
constexprnoexcept |
If set==true
, sets the bits
in store
, i.e.
equivalent to store |= bits
operation.
Otherwise clears the bits
in store
, i.e. equivalent to store &= ~bits
operation.
Returns store reference.
Definition at line 210 of file enum_util.hpp.
|
constexprnoexcept |
Definition at line 219 of file enum_util.hpp.
|
constexprnoexcept |
Definition at line 224 of file enum_util.hpp.
|
constexprnoexcept |
Definition at line 229 of file enum_util.hpp.
|
constexprnoexcept |
|
constexprnoexcept |
|
constexpr |
Definition at line 244 of file enum_util.hpp.
|
inline |
Definition at line 253 of file enum_util.hpp.
|
inline |
Definition at line 335 of file enum_util.hpp.
|
noexcept |
Returns true if compiled with RTTI available.
Definition at line 88 of file type_info.hpp.
|
constexprnoexcept |
Returns the type name of given type T
using template Compile Time Type Information (CTTI) only with static constant storage duration.
T | the type |
Definition at line 108 of file type_info.hpp.
|
constexprnoexcept |
Returns the type name of given function types R(*L)(A...)
using template Compile Time Type Information (CTTI) only with static constant storage duration.
With RTTI or wihout, c-alike function pointer type names like int(*)(int)
do not expose their source location like lambda functions do. Hence they can't be used to compare code identity, but lambda functions can be used.
gcc
or non clang
compilerDue to the lack of standardized Compile-Time Type Information (CTTI), we rely on the non-standardized macro extensions
__PRETTY_FUNCTION__
clang
produces a unique tag using filename and line number, compatible.gcc
produces a non-unique tag using the parent function of the lambda location and its too brief signature, not fully compatible.__FUNCSIG__
msvc++
not testedDue to these restrictions, not using RTTI on gcc
or non clang
compiler will erroneously mistake different lambda functions defined within one function and using same function prototype R<A...>
to be the same.
jau::type_info::limited_lambda_id exposes the potential limitation.
R | function return type |
L | main function type, e.g. a lambda type. |
A | function argument types |
Definition at line 150 of file type_info.hpp.
jau::JAU_MAKE_BITFIELD_ENUM_STRING | ( | type_info_flags_t | , |
obj | , | ||
sig | ) |
|
inline |
Definition at line 370 of file type_info.hpp.
|
noexcept |
Constructs a jau::type_info instance based on given type T
using template Compile Time Type Information (CTTI) only.
This construction function either uses typeid(T)
if jau::type_info::rtti_available == true or jau::ctti_name<T>() otherwise.
T | type for which the type_info is generated |
Definition at line 387 of file type_info.hpp.
|
noexcept |
Returns a static global reference of make_ctti<T>(true) w/ identity instance.
Definition at line 397 of file type_info.hpp.
|
noexcept |
Constructs a jau::type_info instance based on given function types R(*L)(A...)
using template Compile Time Type Information (CTTI) only via RTTI's `typeid(L) if available or jau::ctti_name<R, L, A...>() otherwise.
This construction function either uses typeid(L)
if jau::type_info::rtti_available == true or jau::ctti_name<R, L, A...>() otherwise.
R | function return type used for type_info in case of jau::type_info::rtti_available == false |
L | main function type for which the type_info is generated, e.g. a lambda type. |
A | function argument types used for type_info in case of jau::type_info::rtti_available == false |
Definition at line 418 of file type_info.hpp.
|
noexcept |
Returns a static global reference of make_ctti<R, L, A...>(true) w/ identity instance.
Definition at line 428 of file type_info.hpp.
|
noexcept |
Returns the type name of given type T
using template Compile Time Type Information (CTTI) only via RTTI's typeid(T).name()
if available or jau::ctti_name<T>() otherwise.
T | type for which the type_info is generated |
Definition at line 443 of file type_info.hpp.
|
noexcept |
Returns the type name of given function types R(*L)(A...)
using template Compile Time Type Information (CTTI) only via RTTI's typeid(L).name()
if available or jau::ctti_name<R, L, A...>() otherwise.
R | function return type used for type_info in case of jau::type_info::rtti_available == false |
L | main function type for which the type_info is generated, e.g. a lambda type. |
A | function argument types used for type_info in case of jau::type_info::rtti_available == false |
Definition at line 463 of file type_info.hpp.
|
constexprnoexcept |
Definition at line 61 of file type_traits_queries.hpp.
|
constexprnoexcept |
Definition at line 64 of file type_traits_queries.hpp.
|
constexprnoexcept |
Definition at line 67 of file type_traits_queries.hpp.
|
constexprnoexcept |
Definition at line 70 of file type_traits_queries.hpp.
|
constexprnoexcept |
Definition at line 73 of file type_traits_queries.hpp.
|
constexprnoexcept |
Definition at line 76 of file type_traits_queries.hpp.
|
constexprnoexcept |
|
constexpr |
Value access of has_builtin_bit_cast type trait for convenience .
Dummy_type | just to make template SFINAE happy |
Definition at line 298 of file cpp_lang_util.hpp.
|
inlineconstexpr |
Template type trait helper evaluating true if RTTI is available, otherwise false.
_Dummy | unused dummy type to satisfy SFINAE |
Definition at line 85 of file type_info.hpp.
|
inlineconstexpr |
Definition at line 274 of file type_traits_queries.hpp.
|
inlineconstexpr |
Definition at line 290 of file type_traits_queries.hpp.
|
inlineconstexpr |
Definition at line 299 of file type_traits_queries.hpp.
|
inlineconstexpr |
Definition at line 377 of file type_traits_queries.hpp.
|
inlineconstexpr |
Definition at line 380 of file type_traits_queries.hpp.
|
inlineconstexpr |
Definition at line 389 of file type_traits_queries.hpp.