8 #ifdef __cpp_constexpr_dynamic_alloc
9 #define BS_CONSTEXPR constexpr
23 m_Constructed(
false) {}
35 template<
typename U,
typename = std::enable_if_t<std::is_assignable_v<T&, U>>>
38 m_Value = std::forward<U>(arg);
73 template<
typename U,
typename = std::enable_if_t<std::is_assignable_v<T&, U>>>
76 m_Value = std::forward<U>(arg);
94 using in = std::conditional_t<(
sizeof(T) <= 16 && std::is_trivially_copy_constructible_v<T>), std::add_const_t<T>, std::add_lvalue_reference_t<std::add_const_t<T>>>;
99 template<
typename Stream,
typename T>
100 using inout = std::conditional_t<Stream::writing, in<T>, std::add_lvalue_reference_t<T>>;
106 template<
typename Lambda>
110 constexpr
finally(Lambda func) noexcept :
122 template<
typename Lambda>
#define BS_BREAKPOINT()
Definition: assert.h:17
Test type.
Definition: parameter.h:108
~finally()
Definition: parameter.h:113
Definition: parameter.h:64
BS_CONSTEXPR T & operator*() noexcept
Definition: parameter.h:83
BS_CONSTEXPR out & operator=(U &&arg) noexcept(std::is_nothrow_assignable_v< T &, U >)
Definition: parameter.h:74
BS_CONSTEXPR out(T &value) noexcept
Definition: parameter.h:66
BS_CONSTEXPR T * operator->() noexcept
Definition: parameter.h:81
Definition: bounded_range.h:28
std::conditional_t<(sizeof(T)<=16 &&std::is_trivially_copy_constructible_v< T >), std::add_const_t< T >, std::add_lvalue_reference_t< std::add_const_t< T > >> in
Passes by const or const reference depending on size.
Definition: parameter.h:94
std::conditional_t< Stream::writing, in< T >, std::add_lvalue_reference_t< T > > inout
Passes by reference.
Definition: parameter.h:100
#define BS_CONSTEXPR
Definition: parameter.h:11