Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
Go to the documentation of this file.
25 #ifndef CPP_LANG_EXT_HPP_
26 #define CPP_LANG_EXT_HPP_
28 #include <type_traits>
49 #if __cplusplus > 201703L
50 #define consteval_cxx20 consteval
52 #define consteval_cxx20 constexpr
73 #if __cplusplus > 201703L
74 #define constinit_cxx20 constinit
76 #define constinit_cxx20 constexpr
92 #if __cplusplus > 201703L
93 #define constexpr_cxx20 constexpr
95 #define constexpr_cxx20 inline
115 #define constexpr_non_literal_var inline
132 #define constexpr_atomic inline
134 #if defined(__clang__)
135 #if __has_feature(cxx_rtti)
145 #define __cxx_rtti_available__ 1
148 #if defined(__GXX_RTTI) || defined(_CPPRTTI)
158 #define __cxx_rtti_available__ 1
168 #if defined __has_builtin
169 #if __has_builtin(__builtin_bit_cast)
170 #define __has_builtin_bit_cast 1
181 template <
typename Dummy_type>
183 #if defined __has_builtin_bit_cast
196 #if !defined __has_builtin_bit_cast
203 #define __builtin_bit_cast(Dest_type,Value_arg) 0
207 template<
class Dummy_type>
209 std::enable_if_t< has_builtin_bit_cast_v<Dummy_type>,
bool> =
true ) noexcept
214 template<
class Dummy_type>
216 std::enable_if_t< !has_builtin_bit_cast_v<Dummy_type>,
bool> =
true ) noexcept
244 return impl::has_builtin_bit_cast_impl<bool>();
260 template <
class Dest,
class Source>
262 typename std::enable_if_t<
263 sizeof(Dest) ==
sizeof(Source) &&
264 std::is_trivially_copyable_v<Dest> &&
265 std::is_trivially_copyable_v<Source>,
295 template <
class Dest,
class Source>
297 typename std::enable_if_t<
298 sizeof(Dest) ==
sizeof(Source) &&
299 std::is_pointer_v<Source> &&
300 std::is_pointer_v<Dest>,
308 return reinterpret_cast<Dest
>(src);
constexpr bool is_builtin_bit_cast_available() noexcept
Query whether __builtin_bit_cast(Dest_type, arg) is available, using jau::has_builtin_bit_cast.
constexpr bool has_builtin_bit_cast_v
Value access of has_builtin_bit_cast type trait for convenience .
constexpr bool has_builtin_bit_cast_impl(std::enable_if_t< has_builtin_bit_cast_v< Dummy_type >, bool >=true) noexcept
#define __builtin_bit_cast(Dest_type, Value_arg)
Dummy definition in the absence of this builtin function as required to have this compilation unit co...
constexpr std::enable_if_t< sizeof(Dest)==sizeof(Source) &&std::is_pointer_v< Source > &&std::is_pointer_v< Dest >, Dest > pointer_cast(const Source &src) noexcept
A constexpr pointer cast implementation for C++17, inspired by C++20 bit_cast<>(arg).
constexpr std::enable_if_t< sizeof(Dest)==sizeof(Source) &&std::is_trivially_copyable_v< Dest > &&std::is_trivially_copyable_v< Source >, Dest > bit_cast(const Source &src) noexcept
C++20 bit_cast<>(arg) implementation for C++17.
Convenience type trait for __has_builtin(__builtin_bit_cast).