uTL
micro Template library
sfinae.h
Go to the documentation of this file.
1 
20 #ifndef __utl_meta_sfinae_h__
21 #define __utl_meta_sfinae_h__
22 
23 #include <utl/core/impl.h>
24 #include <type_traits>
25 
31 namespace utl {
33 namespace meta {
34 
37  namespace detail {
38 // template <typename... T>
39 // struct dev_null { using type = dev_null; }; //< Same as typelist
40 
41  template <bool If> struct when_ { };
42  template <> struct when_<true> { using type = void; };
43  }
45  template <bool If>
47 
48 // //! Well formed only if all of \p Ifs are \c true
49 // template <bool ...Ifs>
50 // using when_all = detail::dev_null<
51 // when<Ifs>...
52 // >;
53 
55 
58 
60  template <bool If, typename _Tp = void> using enable_if = std::enable_if<If, _Tp>;
61 
63  template<bool If, typename _Tp = void> using enable_if_t = eval< enable_if<If, _Tp> >;
64 
66 
67 }}
68 
70 
71 #endif /* __utl_meta_sfinae_h__ */
std::enable_if< If, _Tp > enable_if
enable_if, imported from stl
Definition: sfinae.h:60
typename Tp::type eval
Type alias for Tp::type. Used to evaluate/extract return type of metafunctions.
Definition: integral.h:49
STL&#39;s core language concepts.
Definition: _1wire.h:30
eval< enable_if< If, _Tp > > enable_if_t
alias template for enable_if
Definition: sfinae.h:63
eval< detail::when_< If > > when
Well formed only if If is true.
Definition: sfinae.h:46
Implementation detail main forward header.