5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_MANIPULATION_EBO_HOLDER_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_MANIPULATION_EBO_HOLDER_HPP_
11#include "arene/base/stdlib_choice/enable_if.hpp"
12#include "arene/base/stdlib_choice/forward.hpp"
13#include "arene/base/stdlib_choice/is_class.hpp"
14#include "arene/base/stdlib_choice/is_constructible.hpp"
15#include "arene/base/stdlib_choice/is_default_constructible.hpp"
16#include "arene/base/stdlib_choice/is_final.hpp"
17#include "arene/base/stdlib_choice/is_same.hpp"
18#include "arene/base/stdlib_choice/move.hpp"
56 template <class T = Value, constraints<std::enable_if_t<std::is_default_constructible<T>::value>> =
nullptr>
57 constexpr ebo_holder() noexcept(
std::is_nothrow_default_constructible<T>::value)
61 ARENE_IGNORE_ARMCLANG(
"-Wimplicit-int-float-conversion",
"This type supports the same conversions as the Value");
80 : value_{
std::forward<Args>(args)...} {}
118template <
typename Tag,
typename Value>
132 template <class T = Value, constraints<std::enable_if_t<std::is_default_constructible<T>::value>> =
nullptr>
133 constexpr ebo_holder() noexcept(
std::is_nothrow_default_constructible<T>::value)
149 type_list<ebo_holder>,
150 type_list<remove_cvref_t<Args>...>
156 : Value{
std::forward<Args>(args)...} {}
167 return static_cast<value_type const&&
>(*this);
constexpr auto get_value(Tag) &&noexcept -> value_type &&
Get the value.
Definition ebo_holder.hpp:171
constexpr auto get_value(Tag) const &&noexcept -> value_type const &&
Get the value.
Definition ebo_holder.hpp:166
constexpr auto get_value(Tag) &noexcept -> value_type &
Get the value.
Definition ebo_holder.hpp:163
Value value_type
The type held by the EBO holder.
Definition ebo_holder.hpp:123
constexpr ebo_holder() noexcept(std::is_nothrow_default_constructible< T >::value)
default constructor
Definition ebo_holder.hpp:133
constexpr ebo_holder(Args &&... args) noexcept(std::is_nothrow_constructible< Value, Args &&... >::value)
in-place constructor
Definition ebo_holder.hpp:155
constexpr auto get_value(Tag) const &noexcept -> value_type const &
Get the value.
Definition ebo_holder.hpp:160
constexpr auto get_value(Tag) &noexcept -> value_type &
Get the value.
Definition ebo_holder.hpp:99
ARENE_IGNORE_ARMCLANG("-Wimplicit-int-float-conversion", "This type supports the same conversions as the Value")
constexpr ebo_holder() noexcept(std::is_nothrow_default_constructible< T >::value)
default constructor
Definition ebo_holder.hpp:57
constexpr auto get_value(Tag) const &&noexcept -> value_type const &&
Get the value.
Definition ebo_holder.hpp:105
Func value_type
Definition ebo_holder.hpp:49
constexpr ebo_holder(Args &&... args) noexcept(std::is_nothrow_constructible< Value, Args &&... >::value)
in-place constructor
Definition ebo_holder.hpp:79
constexpr auto get_value(Tag) &&noexcept -> value_type &&
Get the value.
Definition ebo_holder.hpp:109
constexpr auto get_value(Tag) const &noexcept -> value_type const &
Get the value.
Definition ebo_holder.hpp:89
static constexpr value_type value
Definition integral_constant.hpp:34
Type trait to detect if a type is constructible from arguments of the specified types.
Definition is_constructible.hpp:29
Type trait to detect if a type is constructible from arguments of the specified types and is noexcept...
Definition is_constructible.hpp:84
Trait to detect if the two template parameters are the same or not. The value member is true if the t...
Definition is_same.hpp:35
Provides macros used to disable and enable compiler specific diagnostics using the _Pragma operator.
#define ARENE_IGNORE_END()
Ends a region of a suppressed diagnostic.
Definition diagnostics.hpp:136
#define ARENE_IGNORE_START()
Begins a region of a suppressed diagnostic.
Definition diagnostics.hpp:131
Definition accumulate.hpp:37
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
Definition accumulate.hpp:36
constexpr auto move(T &&value) noexcept -> remove_reference_t< T > &&
Cast a value to an rvalue.
Definition move.hpp:30
typename enable_if< Condition, Type >::type enable_if_t
Type alias to support constraining templates. Is an alias for the specified type if the Condition is ...
Definition enable_if.hpp:41
an empty struct that is a list of types - cheaper to instantiate than tuple
Definition type_list.hpp:19