4.6.0
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
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>
requires ( fcppt::enum_::size<Enum>::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>
requires ( fcppt::enum_::size<Enum>::value == sizeof...(Args) && std::conjunction_v<std::is_constructible<Value, Args>...>)
fcppt::enum_::array< Enum, Value >::array ( Args && ...) const
explicitconstexprnoexcept

◆ array() [2/2]

template<typename Enum , typename Value >
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 ( )
nodiscard

◆ begin() [2/2]

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

◆ data() [1/2]

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

◆ data() [2/2]

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

◆ end() [1/2]

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

◆ end() [2/2]

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

◆ impl() [1/2]

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

◆ impl() [2/2]

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

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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