4.4.1
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions
fcppt::enum_::array< Enum, Value > Class Template Reference

Detailed Description

template<typename Enum, typename Value>
class fcppt::enum_::array< Enum, Value >

An array indexed with an enum.

This class is like fcppt::array::object, except that operator[] takes a parameter of type Enum. This class is meant to be used with contiguous enums.

Template Parameters
EnumThe enum type to use as an index which also determines the array's size.

Classes

struct  from_internal
 

Public Types

using enum_type = Enum
 
using static_size = fcppt::enum_::size< Enum >
 
using internal = fcppt::array::object< Value, static_size::value >
 
using value_type = typename internal::value_type
 
using reference = typename internal::reference
 
using const_reference = typename internal::const_reference
 
using iterator = typename internal::iterator
 
using const_iterator = typename internal::const_iterator
 
using pointer = typename internal::pointer
 
using const_pointer = typename internal::const_pointer
 

Public Member Functions

template<typename... Args, typename = std::enable_if_t< static_size::value == sizeof...(Args) && std::conjunction_v<std::is_constructible<Value, Args>...>>>
constexpr array (Args &&...) noexcept(std::conjunction_v< std::is_nothrow_constructible< Value, Args >... >)
 
constexpr array (from_internal, internal &&) noexcept(std::is_nothrow_move_constructible_v< internal >)
 
reference operator[] (Enum) noexcept
 
const_reference operator[] (Enum) const noexcept
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
pointer data ()
 
const_pointer data () const
 
constexpr internalimpl () noexcept
 
constexpr internal const & impl () const noexcept
 

Member Typedef Documentation

◆ const_iterator

template<typename Enum , typename Value >
using fcppt::enum_::array< Enum, Value >::const_iterator = typename internal::const_iterator

◆ const_pointer

template<typename Enum , typename Value >
using fcppt::enum_::array< Enum, Value >::const_pointer = typename internal::const_pointer

◆ const_reference

template<typename Enum , typename Value >
using fcppt::enum_::array< Enum, Value >::const_reference = typename internal::const_reference

◆ enum_type

template<typename Enum , typename Value >
using fcppt::enum_::array< Enum, Value >::enum_type = Enum

◆ internal

template<typename Enum , typename Value >
using fcppt::enum_::array< Enum, Value >::internal = fcppt::array::object<Value, static_size::value>

◆ iterator

template<typename Enum , typename Value >
using fcppt::enum_::array< Enum, Value >::iterator = typename internal::iterator

◆ pointer

template<typename Enum , typename Value >
using fcppt::enum_::array< Enum, Value >::pointer = typename internal::pointer

◆ reference

template<typename Enum , typename Value >
using fcppt::enum_::array< Enum, Value >::reference = typename internal::reference

◆ static_size

template<typename Enum , typename Value >
using fcppt::enum_::array< Enum, Value >::static_size = fcppt::enum_::size<Enum>

◆ value_type

template<typename Enum , typename Value >
using fcppt::enum_::array< Enum, Value >::value_type = typename internal::value_type

Constructor & Destructor Documentation

◆ array() [1/2]

template<typename Enum , typename Value >
template<typename... Args, typename = std::enable_if_t< static_size::value == sizeof...(Args) && std::conjunction_v<std::is_constructible<Value, Args>...>>>
constexpr fcppt::enum_::array< Enum, Value >::array ( Args &&  ...) const
explicitconstexprnoexcept

◆ array() [2/2]

template<typename Enum , typename Value >
constexpr fcppt::enum_::array< Enum, Value >::array ( from_internal  ,
internal &&   
) const
constexprnoexcept

Member Function Documentation

◆ begin() [1/2]

template<typename Enum , typename Value >
iterator fcppt::enum_::array< Enum, Value >::begin ( )

◆ begin() [2/2]

template<typename Enum , typename Value >
const_iterator fcppt::enum_::array< Enum, Value >::begin ( ) const

◆ data() [1/2]

template<typename Enum , typename Value >
pointer fcppt::enum_::array< Enum, Value >::data ( )

◆ data() [2/2]

template<typename Enum , typename Value >
const_pointer fcppt::enum_::array< Enum, Value >::data ( ) const

◆ end() [1/2]

template<typename Enum , typename Value >
iterator fcppt::enum_::array< Enum, Value >::end ( )

◆ end() [2/2]

template<typename Enum , typename Value >
const_iterator fcppt::enum_::array< Enum, Value >::end ( ) const

◆ impl() [1/2]

template<typename Enum , typename Value >
constexpr internal const & fcppt::enum_::array< Enum, Value >::impl ( ) const
constexprnoexcept

◆ impl() [2/2]

template<typename Enum , typename Value >
constexpr internal & fcppt::enum_::array< Enum, Value >::impl ( )
constexprnoexcept

◆ operator[]() [1/2]

template<typename Enum , typename Value >
const_reference fcppt::enum_::array< Enum, Value >::operator[] ( Enum  ) const
noexcept

◆ operator[]() [2/2]

template<typename Enum , typename Value >
reference fcppt::enum_::array< Enum, Value >::operator[] ( Enum  )
noexcept