Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::ebo_holder< Tag, Value, bool > Class Template Reference

A class to hold an instance of a type that is likely to be empty, such as a comparator or allocator, making use of the empty base class optimization if possible. More...

Inheritance diagram for arene::base::ebo_holder< Tag, Value, bool >:
Inheritance graph

Public Types

using value_type = Value
 The type held by the EBO holder.
 

Public Member Functions

template<class T = Value, constraints< std::enable_if_t< std::is_default_constructible< T >::value > > = nullptr>
constexpr ebo_holder () noexcept(std::is_nothrow_default_constructible< T >::value)
 default constructor
 
template<class... Args, constraints< std::enable_if_t< std::is_constructible< Value, Args &&... >::value >, std::enable_if_t< !std::is_same< type_list< ebo_holder >, type_list< remove_cvref_t< Args >... > >::value > > = nullptr>
constexpr ebo_holder (Args &&... args) noexcept(std::is_nothrow_constructible< Value, Args &&... >::value)
 in-place constructor
 
 ARENE_IGNORE_ARMCLANG ("-Wimplicit-int-float-conversion", "This type supports the same conversions as the Value")
 
 ARENE_IGNORE_END ()
 
 ARENE_IGNORE_START ()
 
constexpr auto get_value (Tag) &&noexcept -> value_type &&
 Get the value.
 
constexpr auto get_value (Tag) &noexcept -> value_type &
 Get the value.
 
constexpr auto get_value (Tag) const &&noexcept -> value_type const &&
 Get the value.
 
constexpr auto get_value (Tag) const &noexcept -> value_type const &
 Get the value.
 

Detailed Description

template<typename Tag, typename Value, bool = std::is_class<Value>::value && !std::is_final<Value>::value>
class arene::base::ebo_holder< Tag, Value, bool >

A class to hold an instance of a type that is likely to be empty, such as a comparator or allocator, making use of the empty base class optimization if possible.

Template Parameters
TagA tag type to indicate this instance, for classes that have multiple values to hold
ValueThe type of the value to hold

Member Typedef Documentation

◆ value_type

template<typename Tag, typename Value, bool = std::is_class<Value>::value && !std::is_final<Value>::value>
using arene::base::ebo_holder< Tag, Value, bool >::value_type = Value

The type held by the EBO holder.

Constructor & Destructor Documentation

◆ ebo_holder() [1/2]

template<typename Tag, typename Value, bool = std::is_class<Value>::value && !std::is_final<Value>::value>
template<class T = Value, constraints< std::enable_if_t< std::is_default_constructible< T >::value > > = nullptr>
arene::base::ebo_holder< Tag, Value, bool >::ebo_holder ( )
inlineconstexprnoexcept

default constructor

Template Parameters
Ttemplate parameter used to check constraints

Value initializes the contained value.

◆ ebo_holder() [2/2]

template<typename Tag, typename Value, bool = std::is_class<Value>::value && !std::is_final<Value>::value>
template<class... Args, constraints< std::enable_if_t< std::is_constructible< Value, Args &&... >::value >, std::enable_if_t< !std::is_same< type_list< ebo_holder >, type_list< remove_cvref_t< Args >... > >::value > > = nullptr>
arene::base::ebo_holder< Tag, Value, bool >::ebo_holder ( Args &&... args)
inlineexplicitconstexprnoexcept

in-place constructor

Template Parameters
Argstypes to construct from
Parameters
argsarguments to construct from

Constructs value from args.

Member Function Documentation

◆ ARENE_IGNORE_ARMCLANG()

template<typename Tag, typename Value, bool = std::is_class<Value>::value && !std::is_final<Value>::value>
arene::base::ebo_holder< Tag, Value, bool >::ARENE_IGNORE_ARMCLANG ( "-Wimplicit-int-float-conversion" ,
"This type supports the same conversions as the Value"  )

◆ ARENE_IGNORE_END()

template<typename Tag, typename Value, bool = std::is_class<Value>::value && !std::is_final<Value>::value>
arene::base::ebo_holder< Tag, Value, bool >::ARENE_IGNORE_END ( )

◆ ARENE_IGNORE_START()

template<typename Tag, typename Value, bool = std::is_class<Value>::value && !std::is_final<Value>::value>
arene::base::ebo_holder< Tag, Value, bool >::ARENE_IGNORE_START ( )

◆ get_value() [1/4]

template<typename Tag, typename Value, bool = std::is_class<Value>::value && !std::is_final<Value>::value>
auto arene::base::ebo_holder< Tag, Value, bool >::get_value ( Tag ) && -> value_type&&
inlineconstexprnoexcept

Get the value.

Returns
value_type&& A reference to the held value

◆ get_value() [2/4]

template<typename Tag, typename Value, bool = std::is_class<Value>::value && !std::is_final<Value>::value>
auto arene::base::ebo_holder< Tag, Value, bool >::get_value ( Tag ) & -> value_type&
inlineconstexprnoexcept

Get the value.

Returns
value_type& A reference to the held value

◆ get_value() [3/4]

template<typename Tag, typename Value, bool = std::is_class<Value>::value && !std::is_final<Value>::value>
auto arene::base::ebo_holder< Tag, Value, bool >::get_value ( Tag ) const && -> value_type const&&
inlineconstexprnoexcept

Get the value.

Returns
const value_type&& A reference to the held value

◆ get_value() [4/4]

template<typename Tag, typename Value, bool = std::is_class<Value>::value && !std::is_final<Value>::value>
auto arene::base::ebo_holder< Tag, Value, bool >::get_value ( Tag ) const & -> value_type const&
inlineconstexprnoexcept

Get the value.

Returns
const value_type& A reference to the held value

The documentation for this class was generated from the following file: