17 #if defined(__has_cpp_attribute)
20 #if __has_cpp_attribute(nodiscard) && \
21 !(defined(__clang__) && __cplusplus < 201703L)
22 #define RESTINIO_NODISCARD [[nodiscard]]
25 #if __has_cpp_attribute(fallthrough) && \
26 !(defined(__clang__) && __cplusplus < 201703L)
27 #define RESTINIO_FALLTHROUGH [[fallthrough]]
32 #if !defined( RESTINIO_NODISCARD )
33 #define RESTINIO_NODISCARD
36 #if !defined( RESTINIO_FALLTHROUGH )
37 #define RESTINIO_FALLTHROUGH
60 #define RESTINIO_ENSURE_NOEXCEPT_CALL(expr) \
61 static_assert(noexcept(expr), "this call is expected to be noexcept: " #expr); \
89 #define RESTINIO_STATIC_ASSERT_NOEXCEPT(expr) \
90 static_assert(noexcept(expr), #expr " is expected to be noexcept" )
116 #define RESTINIO_STATIC_ASSERT_NOT_NOEXCEPT(expr) \
117 static_assert(!noexcept(expr), #expr " is not expected to be noexcept" )
122 namespace static_if_details
125 template<
bool Condition >
131 template<
typename If_Part,
typename Else_Part>
132 static decltype(
auto)
133 call( If_Part && if_part, Else_Part && )
142 template<
typename If_Part,
typename Else_Part>
143 static decltype(
auto)
144 call( If_Part &&, Else_Part && else_part )
174 template<
bool Condition,
typename If_Part,
typename Else_Part >
179 std::forward<If_Part>(if_part),
180 std::forward<Else_Part>(else_part) );