2.10.0
Freundlich's C++ toolkit
Classes | Typedefs | Functions
fcppt::enum_ Namespace Reference

Classes

class  array
 An array indexed with an enum. More...
 
struct  from_string_impl
 
class  iterator
 
struct  max_value
 The maximum enumerator in an enum. More...
 
struct  min_value
 The minimum enumerator in an enum. More...
 
struct  names_impl
 
struct  names_impl< fcppt::log::level >
 
class  range
 A range over a contiguous enum. More...
 
struct  size
 The number of enumerators in an enum. More...
 
struct  size_type_impl
 
struct  to_string_impl
 

Typedefs

template<typename Enum >
using names_array = fcppt::enum_::array< Enum, fcppt::string >
 Array type for The names of an enum. More...
 
template<typename Type >
using size_type = typename fcppt::enum_::size_type_impl< Type >::type
 The size type used to count the number of enumerators in an enum. More...
 

Functions

template<typename Enum , typename Value >
bool operator== (fcppt::enum_::array< Enum, Value > const &_a, fcppt::enum_::array< Enum, Value > const &_b)
 Compares two enum arrays for equality. More...
 
template<typename Enum , typename Value >
bool operator!= (fcppt::enum_::array< Enum, Value > const &_a, fcppt::enum_::array< Enum, Value > const &_b)
 Compares two enum arrays for inequality. More...
 
template<typename Enum , typename Value >
FCPPT_PP_POP_WARNING void swap (fcppt::enum_::array< Enum, Value > &, fcppt::enum_::array< Enum, Value > &)
 
template<typename Array , typename Function >
Array array_init (Function const &_function)
 Constructs an array by calling a function with static enumerators. More...
 
template<typename Enum , typename Value >
fcppt::optional::object< Enum > from_int (Value const &_value) noexcept
 Cast an unsigned value to an enum. More...
 
template<typename Enum , typename Value >
Enum from_int_exn (Value const &_value)
 Cast an unsigned value to an enum. More...
 
template<typename Enum >
fcppt::optional::object< Enum > from_string (fcppt::string const &_string)
 Converts a string to an enum. More...
 
template<typename Enum , typename Value >
fcppt::optional::object< Enum > index_of_array (fcppt::enum_::array< Enum, Value > const &_array, Value const &_value)
 Returns the enum of the first element found in an enum array. More...
 
template<typename Enum >
fcppt::io::istreaminput (fcppt::io::istream &_stream, Enum &_result)
 Reads an enum value from a stream. More...
 
template<typename Enum >
fcppt::enum_::range< Enum > make_range () noexcept
 Creates an enum range over the whole enum. More...
 
template<typename Enum >
fcppt::enum_::range< Enum > make_range_start (Enum const _start) noexcept
 Creates an enum range with a custom start value. More...
 
template<typename Enum >
fcppt::enum_::range< Enum > make_range_start_end (Enum const _start, Enum const _end) noexcept
 Creates a closed enum range. More...
 
template<typename Enum >
fcppt::enum_::names_array< Enum > const & names ()
 The names of an enum. More...
 
template<typename Enum >
fcppt::io::ostreamoutput (fcppt::io::ostream &_stream, Enum const _value)
 Outputs an enum value to a stream. More...
 
template<typename Enum , typename Function >
decltype(auto) to_static (Enum const _enum, Function const &_function)
 Converts a runtime enum value into a compile time one, passing it to a function. More...
 
template<typename Enum >
fcppt::string to_string (Enum const _enum)
 Converts an enum to a string. More...
 

Function Documentation

◆ swap()

template<typename Enum , typename Value >
FCPPT_PP_POP_WARNING void fcppt::enum_::swap ( fcppt::enum_::array< Enum, Value > &  ,
fcppt::enum_::array< Enum, Value > &   
)