diff --git a/include/utl/concepts/stl.h b/include/utl/concepts/stl.h index 35357d7..d4d2906 100644 --- a/include/utl/concepts/stl.h +++ b/include/utl/concepts/stl.h @@ -34,7 +34,7 @@ namespace utl { template using use_if_same_t = meta::eval< meta::enable_if< - meta::same_<_T1, _T2>::value, _Ret + meta::same<_T1, _T2>::value, _Ret > >; @@ -43,7 +43,7 @@ namespace utl { * Same */ template - _utlConcept Same = meta::same_::value; + _utlConcept Same = meta::same::value; // template // _utlConcept Decayed = Same>; diff --git a/include/utl/dev/dev_iterators.h b/include/utl/dev/dev_iterators.h index 09e64ff..abd5f40 100644 --- a/include/utl/dev/dev_iterators.h +++ b/include/utl/dev/dev_iterators.h @@ -398,7 +398,7 @@ namespace utl { typename T::difference_type; typename T::pointer; typename T::reference; - requires same_< + requires same< typename T::iterator_category, std::output_iterator_tag >::value; @@ -675,7 +675,7 @@ namespace utl { typename T::difference_type; typename T::pointer; typename T::reference; - requires same_ < + requires same < typename T::iterator_category, std::input_iterator_tag >::value; @@ -960,7 +960,7 @@ namespace utl { typename T::difference_type; typename T::pointer; typename T::reference; - requires same_< + requires same< typename T::iterator_category, std::input_iterator_tag >::value; diff --git a/include/utl/meta/basic.h b/include/utl/meta/basic.h index 0a38d62..c2ef3e9 100644 --- a/include/utl/meta/basic.h +++ b/include/utl/meta/basic.h @@ -292,13 +292,13 @@ namespace meta{ //! \name same //! @{ template - struct same_ : false_ { }; + struct same : false_ { }; template - struct same_ : true_ { }; + struct same : true_ { }; template - using not_same_ = not_>>; + using not_same = not_>>; //! @} //! @} diff --git a/include/utl/meta/detection.h b/include/utl/meta/detection.h index 806397d..993ddcb 100644 --- a/include/utl/meta/detection.h +++ b/include/utl/meta/detection.h @@ -179,7 +179,7 @@ namespace meta { template class Op, typename... Args > using is_detected_exact = eval < - same_> + same> >; //! evaluates to true if evaluation of Op is \p Expected and to false if not diff --git a/include/utl/meta/invoke.h b/include/utl/meta/invoke.h index 24c74c2..1bba1a9 100644 --- a/include/utl/meta/invoke.h +++ b/include/utl/meta/invoke.h @@ -140,7 +140,7 @@ namespace meta{ static nil_ check (...); //< all other combinations using type = if_ < - not_same_< + not_same< nil_, decltype(check(0)) >, true_, false_ @@ -419,13 +419,13 @@ namespace meta{ template struct same_as { template - struct apply : same_ { }; + struct apply : same { }; }; template struct not_same_as { template - struct apply : not_same_ { }; + struct apply : not_same { }; }; }} diff --git a/include/utl/meta/sfinae.h b/include/utl/meta/sfinae.h index d537d52..032c68b 100644 --- a/include/utl/meta/sfinae.h +++ b/include/utl/meta/sfinae.h @@ -54,12 +54,12 @@ namespace meta { //! If same type resolves to _Ret, else SFINAE template using use_if_same_t = enable_if_t< - same_<_T1, _T2>::value, _Ret + same<_T1, _T2>::value, _Ret >; //! If not same type resolves to _Ret, else SFINAE template using use_if_not_same_t = enable_if_t< - !same_<_T1, _T2>::value, _Ret + !same<_T1, _T2>::value, _Ret >; //! If any type (_T1 or _T2) type resolves to _Ret, else to SFINAE template diff --git a/include/utl/meta/typelist.h b/include/utl/meta/typelist.h index 86cdc65..6e62651 100644 --- a/include/utl/meta/typelist.h +++ b/include/utl/meta/typelist.h @@ -705,6 +705,9 @@ namespace meta { using seek = seek_if >; //! @} + template + using first_if = front>; + //! \name count_if //! @{ namespace count_if_impl { diff --git a/test/tests/TmetaBasic.cpp b/test/tests/TmetaBasic.cpp index 1caa9d5..6d39f7c 100644 --- a/test/tests/TmetaBasic.cpp +++ b/test/tests/TmetaBasic.cpp @@ -140,9 +140,9 @@ namespace TmetaBasic { EXPECT_EQ (true, (std::is_same>())); EXPECT_EQ (true, (std::is_same>())); - EXPECT_EQ (true, (same_())); - EXPECT_EQ (false, (same_())); - EXPECT_EQ (true, (not_same_())); + EXPECT_EQ (true, (same())); + EXPECT_EQ (false, (same())); + EXPECT_EQ (true, (not_same())); } @@ -218,11 +218,11 @@ namespace TmetaBasic { /* * SFINAE */ - template ::type::value>> + template ::type::value>> int check1 (T x) { return x; } int check1 (...) { return 0; } - template ::type::value, void>> + template ::type::value, void>> int check2 (T x) { return x; } int check2 (...) { return 0; }