integral.h
Go to the documentation of this file.
#ifndef __utl_meta_integralconstant_h__
#define __utl_meta_integralconstant_h__
#include <utl/core/impl.h>
#include <type_traits>
#include <utility>
namespace utl {
namespace meta {
struct nil_ {
using type = nil_;
};
template <typename Tp>
using eval = typename Tp::type;
template <typename Tp, Tp v>
using integral_ = std::integral_constant<Tp, v>;
template<bool v>
using bool_ = integral_<bool, v>;
using true_ = bool_<true>;
using false_ = bool_<false>;
template<int8_t v>
using int8_ = integral_<int8_t, v>;
template<uint8_t v>
using uint8_ = integral_<uint8_t, v>;
template<int16_t v>
using int16_ = integral_<int16_t, v>;
template<uint16_t v>
using uint16_ = integral_<uint16_t, v>;
template<int32_t v>
using int32_ = integral_<int32_t, v>;
template<uint32_t v>
using uint32_ = integral_<uint32_t, v>;
template<char v>
using char_ = integral_<char, v>;
template<int v>
using int_ = integral_<int, v>;
template<long v>
using long_ = integral_<long, v>;
template<index_t v>
using index_ = integral_<index_t, v>;
template<size_t v>
using size_ = integral_<size_t, v>;
template <typename Tp>
using sizeof_ = size_<sizeof(Tp)>;
template <typename Tp>
using alignof_ = size_<alignof(Tp)>;
using Npos = size_<index_t(-1)>;
template< class Tp, Tp... Ints >
using integer_sequence = std::integer_sequence<Tp, Ints...>;
template<typename Tp, Tp Num>
using make_integer_sequence = std::make_integer_sequence<Tp, Num>;
template<index_t... Idx>
using index_sequence = integer_sequence<index_t, Idx...>;
template<index_t Num>
using make_index_sequence = make_integer_sequence <index_t, Num>;
template<typename... Types>
using index_sequence_for = make_index_sequence<sizeof...(Types)>;
}}
#endif /* __utl_meta_integralconstant_h__ */
utl::meta::make_index_sequence
make_integer_sequence< index_t, Num > make_index_sequence
Alias template make_index_sequence.
Definition: integral.h:140
utl::meta::uint8_
integral_< uint8_t, v > uint8_
uint8_ type: integral constant wrapper for uint8_t
Definition: integral.h:76
utl::meta::int8_
integral_< int8_t, v > int8_
int8_ type: integral constant wrapper for int8_t
Definition: integral.h:73
utl::meta::true_
bool_< true > true_
The type used as a compile-time boolean with true value.
Definition: integral.h:68
utl::meta::size_
integral_< size_t, v > size_
size_ type: integral constant wrapper for size_t a.k.a std::size_t
Definition: integral.h:110
utl::meta::long_
integral_< long, v > long_
long_ type: integral constant wrapper for long
Definition: integral.h:102
utl::meta::nil_
Definition: integral.h:43
utl::meta::integral_
std::integral_constant< Tp, v > integral_
Definition: integral.h:58
utl::meta::Npos
size_< index_t(-1)> Npos
The last position we can express for indexing.
Definition: integral.h:124
utl::meta::make_integer_sequence
std::make_integer_sequence< Tp, Num > make_integer_sequence
Definition: integral.h:132
utl::meta::int_
integral_< int, v > int_
int_ type: integral constant wrapper for int
Definition: integral.h:98
utl::meta::index_sequence_for
make_index_sequence< sizeof...(Types)> index_sequence_for
Alias template index_sequence_for.
Definition: integral.h:144
utl::meta::false_
bool_< false > false_
The type used as a compile-time boolean with false value.
Definition: integral.h:69
utl::meta::eval
typename Tp::type eval
Type alias for Tp::type. Used to evaluate/extract return type of metafunctions.
Definition: integral.h:49
utl::meta::char_
integral_< char, v > char_
char_ type: integral constant wrapper for char
Definition: integral.h:94
utl::meta::uint16_
integral_< uint16_t, v > uint16_
uint16_ type: integral constant wrapper for uint16_t
Definition: integral.h:83
utl
STL&#39;s core language concepts.
Definition: _1wire.h:30
utl::meta::index_sequence
integer_sequence< index_t, Idx... > index_sequence
Alias template index_sequence.
Definition: integral.h:136
utl::meta::index_
integral_< index_t, v > index_
index_ type: integral constant wrapper for index_t a.k.a std::size_t
Definition: integral.h:106
utl::meta::alignof_
size_< alignof(Tp)> alignof_
Definition: integral.h:120
utl::meta::bool_
integral_< bool, v > bool_
bool_ type: integral constant wrapper for bool
Definition: integral.h:66
utl::index_t
size_t index_t
index_t and size_t mend to be interchangeable
Definition: types.h:38
utl::meta::int32_
integral_< int32_t, v > int32_
int32_ type: integral constant wrapper for int32_t
Definition: integral.h:87
utl::meta::sizeof_
size_< sizeof(Tp)> sizeof_
Definition: integral.h:115
utl::meta::integer_sequence
std::integer_sequence< Tp, Ints... > integer_sequence
Definition: integral.h:129
utl::meta::uint32_
integral_< uint32_t, v > uint32_
uint32_ type: integral constant wrapper for uint32_t
Definition: integral.h:90
utl::meta::int16_
integral_< int16_t, v > int16_
int16_ type: integral constant wrapper for int16_t
Definition: integral.h:80
impl.h
Implementation detail main forward header.