tinympl  0.2
mini MPL library for C++11
Type wrappers

Typedefs

template<bool i>
using tinympl::bool_ = std::integral_constant< bool, i >
 
template<char i>
using tinympl::char_ = std::integral_constant< char, i >
 
template<int i>
using tinympl::int_ = std::integral_constant< int, i >
 
template<long i>
using tinympl::long_ = std::integral_constant< long, i >
 
template<short i>
using tinympl::short_ = std::integral_constant< short, i >
 
template<std::intmax_t Num, std::intmax_t Den>
using tinympl::rational = typename detail::make_rational< Num, Den >::type
 Convenience wrapper around std::ratio to automatically reduce num and den to coprime factors. More...
 

Detailed Description

Templates which wrap a value into a type.

Typedef Documentation

template<bool i>
using tinympl::bool_ = typedef std::integral_constant<bool,i>

Compile time bool

template<char i>
using tinympl::char_ = typedef std::integral_constant<char,i>

Compile time char

template<int i>
using tinympl::int_ = typedef std::integral_constant<int,i>

Compile time integer

template<long i>
using tinympl::long_ = typedef std::integral_constant<long,i>

Compile time long

template<std::intmax_t Num, std::intmax_t Den>
using tinympl::rational = typedef typename detail::make_rational<Num,Den>::type

Convenience wrapper around std::ratio to automatically reduce num and den to coprime factors.

std::is_same< std::ratio<4,2>, std::ratio<2,1> >::value is false, while std::is_same< rational<4,2>, rational<2,1> >::value is true.

rational forwards to std::ratio. The comparison functionals plus, minus, multiplies, divides, negate, equal_to and less are specialized to work transparently on std::ratio.

template<short i>
using tinympl::short_ = typedef std::integral_constant<short,i>

Compile time short