20#if defined(__has_cpp_attribute)
23 #if __has_cpp_attribute(nodiscard) && \
24 !(defined(__clang__) && __cplusplus < 201703L)
25 #define RESTINIO_NODISCARD [[nodiscard]]
28 #if __has_cpp_attribute(fallthrough) && \
29 !(defined(__clang__) && __cplusplus < 201703L)
30 #define RESTINIO_FALLTHROUGH [[fallthrough]]
35#if !defined( RESTINIO_NODISCARD )
36 #define RESTINIO_NODISCARD
39#if !defined( RESTINIO_FALLTHROUGH )
40 #define RESTINIO_FALLTHROUGH
44#if defined(__cpp_lib_launder)
45 #define RESTINIO_STD_LAUNDER(x) std::launder(x)
47 #define RESTINIO_STD_LAUNDER(x) x
70#define RESTINIO_ENSURE_NOEXCEPT_CALL(expr) \
71 static_assert(noexcept(expr), "this call is expected to be noexcept: " #expr); \
99#define RESTINIO_STATIC_ASSERT_NOEXCEPT(expr) \
100 static_assert(noexcept(expr), #expr " is expected to be noexcept" )
126#define RESTINIO_STATIC_ASSERT_NOT_NOEXCEPT(expr) \
127 static_assert(!noexcept(expr), #expr " is not expected to be noexcept" )
132namespace static_if_details
135template<
bool Condition >
141 template<
typename If_Part,
typename Else_Part>
142 static decltype(
auto)
143 call( If_Part && if_part, Else_Part && )
152 template<
typename If_Part,
typename Else_Part>
153 static decltype(
auto)
154 call( If_Part &&, Else_Part && else_part )
184template<
bool Condition,
typename If_Part,
typename Else_Part >
189 std::forward<If_Part>(if_part),
190 std::forward<Else_Part>(else_part) );
decltype(auto) static_if_else(If_Part &&if_part, Else_Part &&else_part)
An emulation of if constexpr for C++14.
static decltype(auto) call(If_Part &&, Else_Part &&else_part)
static decltype(auto) call(If_Part &&if_part, Else_Part &&)