selection.h
Go to the documentation of this file.
#ifndef __utl_meta_selection_h__
#define __utl_meta_selection_h__
#include <utl/core/impl.h>
#include <utl/meta/integral.h>
namespace utl {
namespace meta{
namespace detail {
template <bool If, typename...>
struct if_c_ {
using type = nil_;
};
template<typename Then>
struct if_c_<true, Then> {
using type = Then;
};
template<typename Then, typename Else>
struct if_c_<true, Then, Else> {
using type = Then;
};
template<typename Then, typename Else>
struct if_c_<false, Then, Else> {
using type = Else;
};
}
template <bool B, typename... Args>
using if_c = eval<detail::if_c_<B, Args...>>;
template <typename If, typename... Args>
using if_ = if_c<If::type::value, Args...>;
template <typename T1, typename ...> using first_of = T1;
template <typename T1, typename T2, typename ...> using second_of = T2;
}}
#endif /* __utl_meta_selection_h__ */
utl::meta::first_of
T1 first_of
Select the first type of a type sequence.
Definition: selection.h:76
utl::meta::detail::if_c_< true, Then >::type
Then type
Definition: selection.h:49
utl::meta::if_
if_c< If::type::value, Args... > if_
Select one type or another depending on a compile-time Boolean type.
Definition: selection.h:66
utl::meta::if_c
eval< detail::if_c_< B, Args... > > if_c
Select one type or another depending on a compile-time Boolean.
Definition: selection.h:62
utl::meta::second_of
T2 second_of
Select the second type of a type sequence.
Definition: selection.h:79
utl::meta::detail::if_c_< true, Then, Else >::type
Then type
Definition: selection.h:53
utl::meta::detail::if_c_< true, Then, Else >
Definition: selection.h:52
utl::meta::nil_
Definition: integral.h:43
utl::meta::detail::if_c_< false, Then, Else >::type
Else type
Definition: selection.h:57
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
STL&#39;s core language concepts.
Definition: _1wire.h:30
utl::meta::detail::if_c_< true, Then >
Definition: selection.h:48
integral.h
utl::meta::detail::if_c_< false, Then, Else >
Definition: selection.h:56
utl::meta::detail::if_c_
Definition: selection.h:44
impl.h
Implementation detail main forward header.