uTL
micro Template library
useif.h
Go to the documentation of this file.
1 
20 #ifndef __utl_meta_useif_h__
21 #define __utl_meta_useif_h__
22 
23 #include <utl/core/impl.h>
24 #include <utl/meta/operations.h>
25 #include <utl/meta/sfinae.h>
26 
32 namespace utl {
34 namespace meta {
35 
37  template <typename _T1, typename _T2, typename _Ret =_T1>
38  using use_if_same_t = enable_if_t<
39  same_<_T1, _T2>::value, _Ret
40  >;
42  template <typename _T1, typename _T2, typename _Ret =_T1>
45  >;
47  template <typename T1, typename... Ts>
48  using use_if_any_t = enable_if_t<
49  or_<T1, Ts...>::value, T1
50  >;
51 
53  template <typename T1, typename... Ts>
54  using use_if_all_t = enable_if_t<
55  and_<T1, Ts...>::value, T1
56  >;
57 
58 }}
59 
61 
62 #endif /* __utl_meta_useif_h__ */
enable_if_t< same_< _T1, _T2 >::value, _Ret > use_if_same_t
If same type resolves to _Ret, else SFINAE.
Definition: useif.h:40
enable_if_t< !same_< _T1, _T2 >::value, _Ret > use_if_not_same_t
If not same type resolves to _Ret, else SFINAE.
Definition: useif.h:45
Integral constant operations and logical operations.
enable_if_t< and_< T1, Ts... >::value, T1 > use_if_all_t
If both type (_T1 and _T2) type resolves to _Ret, else to SFINAE.
Definition: useif.h:56
STL&#39;s core language concepts.
Definition: _1wire.h:30
Template meta-programming SFINAE helpers.
eval< enable_if< If, _Tp > > enable_if_t
alias template for enable_if
Definition: sfinae.h:63
eval< detail::_or_< _Ts... > > or_
Definition: operations.h:70
eval< detail::_and_< _Ts... > > and_
Definition: operations.h:96
enable_if_t< or_< T1, Ts... >::value, T1 > use_if_any_t
If any type (_T1 or _T2) type resolves to _Ret, else to SFINAE.
Definition: useif.h:50
Implementation detail main forward header.