|
Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
#include <type_traits>Go to the source code of this file.
Classes | |
| struct | jau::has_builtin_bit_cast< Dummy_type > |
Convenience type trait for __has_builtin(__builtin_bit_cast). More... | |
Namespaces | |
| jau | |
| jau::impl | |
Macros | |
| #define | consteval_cxx20 constexpr |
consteval qualifier replacement for C++20 consteval. More... | |
| #define | constinit_cxx20 constexpr |
constinit qualifier replacement for C++20 constinit. More... | |
| #define | constexpr_cxx20 inline |
constexpr qualifier replacement for C++20 constexpr. More... | |
| #define | constexpr_non_literal_var inline |
Used when designed to declare a function constexpr, but prohibited by its specific implementation. More... | |
| #define | constexpr_atomic inline |
Used when designed to declare a function constexpr, but prohibited by its specific implementation. More... | |
| #define | __builtin_bit_cast(Dest_type, Value_arg) 0 |
| Dummy definition in the absence of this builtin function as required to have this compilation unit compile clean. More... | |
Functions | |
| template<class Dummy_type > | |
| constexpr bool | jau::impl::has_builtin_bit_cast_impl (std::enable_if_t< has_builtin_bit_cast_v< Dummy_type >, bool >=true) noexcept |
| template<class Dummy_type > | |
| constexpr bool | jau::impl::has_builtin_bit_cast_impl (std::enable_if_t< !has_builtin_bit_cast_v< Dummy_type >, bool >=true) noexcept |
| constexpr bool | jau::is_builtin_bit_cast_available () noexcept |
Query whether __builtin_bit_cast(Dest_type, arg) is available, using jau::has_builtin_bit_cast. More... | |
| 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. More... | |
| 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). More... | |
Variables | |
| template<typename Dummy_type > | |
| constexpr bool | jau::has_builtin_bit_cast_v = has_builtin_bit_cast<Dummy_type>::value |
| Value access of has_builtin_bit_cast type trait for convenience . More... | |
| #define __builtin_bit_cast | ( | Dest_type, | |
| Value_arg | |||
| ) | 0 |
Dummy definition in the absence of this builtin function as required to have this compilation unit compile clean.
| Dest_type | the target type |
| Value_arg | the source value argument |
Definition at line 204 of file cpp_lang_util.hpp.
| #define consteval_cxx20 constexpr |
consteval qualifier replacement for C++20 consteval.
A
constevalspecifier impliesinline. At most one of theconstexpr,consteval, andconstinitspecifiers is allowed to appear within the same sequence of declaration specifiers. ... An immediate function is aconstexprfunction, and must satisfy the requirements applicable toconstexprfunctions orconstexprconstructors, 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 53 of file cpp_lang_util.hpp.
| #define constexpr_atomic inline |
Used when designed to declare a function constexpr, but prohibited by its specific implementation.
Evaluated using the alternative qualifier inline for C++ < 20, as it is implied for constexpr functions or static member variables, see constexpr_cxx20.
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 133 of file cpp_lang_util.hpp.
| #define constexpr_cxx20 inline |
constexpr qualifier replacement for C++20 constexpr.
A
constexprspecifier 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 96 of file cpp_lang_util.hpp.
| #define constexpr_non_literal_var inline |
Used when designed to declare a function constexpr, but prohibited by its specific implementation.
Evaluated using the alternative qualifier inline for C++ < 20, as it is implied for constexpr functions or static member variables, see constexpr_cxx20.
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 116 of file cpp_lang_util.hpp.
| #define constinit_cxx20 constexpr |
constinit qualifier replacement for C++20 constinit.
constinitcannot be used together withconstexprorconsteval. When the declared variable is a reference,constinitis equivalent toconstexpr. When the declared variable is an object,constexprmandates that the object must have static initialization and constant destruction and makes the object const-qualified, however,constinitdoes 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 77 of file cpp_lang_util.hpp.
1.8.18