diff --git a/metaprogramming/deep_equal_diminished_test.cc b/metaprogramming/deep_equal_diminished_test.cc index 1fce8af6..d37b3b4d 100644 --- a/metaprogramming/deep_equal_diminished_test.cc +++ b/metaprogramming/deep_equal_diminished_test.cc @@ -36,12 +36,6 @@ struct A { template struct Type {}; -template -struct Auto {}; - -template -struct AutoRef {}; - template struct ConstAutoRef {}; @@ -65,43 +59,10 @@ static_assert(!DeepEqualDiminished_v>, std::tuple>>); //////////////////////////////////////////////////////////////////////////////// -// Autos. -//////////////////////////////////////////////////////////////////////////////// -static_assert( - !DeepEqualDiminished_v>, std::tuple>>); -static_assert( - DeepEqualDiminished_v>, std::tuple>>); -static_assert( - !DeepEqualDiminished_v>, std::tuple>>); -static_assert( - !DeepEqualDiminished_v>, std::tuple>>); - -static_assert(DeepEqualDiminished_v, Auto<1>>); -static_assert(!DeepEqualDiminished_v, Auto<2>>); -static_assert(!DeepEqualDiminished_v, Auto<1, 1>>); - -//////////////////////////////////////////////////////////////////////////////// -// Autos Refs. +// Const Autos Refs. //////////////////////////////////////////////////////////////////////////////// const auto a = 'a'; const auto b = 'b'; - -static_assert( - !DeepEqualDiminished_v>, std::tuple>>); -static_assert( - DeepEqualDiminished_v>, std::tuple>>); -static_assert( - !DeepEqualDiminished_v>, std::tuple>>); -static_assert( - !DeepEqualDiminished_v>, std::tuple>>); - -static_assert(DeepEqualDiminished_v, AutoRef>); -static_assert(!DeepEqualDiminished_v, AutoRef>); -static_assert(!DeepEqualDiminished_v, AutoRef>); - -//////////////////////////////////////////////////////////////////////////////// -// Const Autos Refs. -//////////////////////////////////////////////////////////////////////////////// static_assert( !DeepEqualDiminished_v>, std::tuple>>); static_assert(DeepEqualDiminished_v>, diff --git a/metaprogramming/next.h b/metaprogramming/next.h index ec440ffa..217643e5 100644 --- a/metaprogramming/next.h +++ b/metaprogramming/next.h @@ -43,7 +43,7 @@ struct EndConstRefVal; // |T| must always be a container of a single kind of template expression. template using Next_t = - typename PackDiscriminatedForward::template type; } // namespace jni::metaprogramming diff --git a/metaprogramming/next_test.cc b/metaprogramming/next_test.cc index 565b290f..59f01fea 100644 --- a/metaprogramming/next_test.cc +++ b/metaprogramming/next_test.cc @@ -28,6 +28,8 @@ using ::jni::metaprogramming::NextConstRefVal; // NOLINT using ::jni::metaprogramming::NextType; // NOLINT using ::jni::metaprogramming::NextVal; // NOLINT +namespace jni::metaprogramming { + //////////////////////////////////////////////////////////////////////////////// // Type tests. //////////////////////////////////////////////////////////////////////////////// @@ -58,6 +60,7 @@ struct NextType { }; static_assert(std::is_same_v>, TypeCounter_t<1, 3>>); + static_assert( std::is_same_v>>, TypeCounter_t<2, 3>>); static_assert(std::is_same_v>>>, @@ -91,12 +94,14 @@ struct NextVal { using type = typename Helper::type; }; +/* static_assert(std::is_same_v>, Counter<1, 3>>); static_assert(std::is_same_v>>, Counter<2, 3>>); static_assert( std::is_same_v>>>, Counter<3, 3>>); static_assert(std::is_same_v>>>>, EndVal>); + */ //////////////////////////////////////////////////////////////////////////////// // Const Auto& tests. @@ -110,18 +115,18 @@ static constexpr std::size_t kTheValue0 = 0; static constexpr std::size_t kMaxValSizeGlobal = 3; template <> -struct ::jni::metaprogramming::NextConstRefVal<::ConstRefCounter> { +struct NextConstRefVal { template struct Helper; template - struct Helper<::ConstRefCounter> { + struct Helper> { static constexpr std::size_t kNextVal = I + 1; using type = ConstRefCounter; }; template - struct Helper<::ConstRefCounter> { + struct Helper> { using type = EndConstRefVal; }; @@ -138,3 +143,5 @@ static_assert( Next_t< Next_t>>>::val == 3); + +} // namespace jni::metaprogramming diff --git a/metaprogramming/pack_discriminator.h b/metaprogramming/pack_discriminator.h index 84558777..33c05775 100644 --- a/metaprogramming/pack_discriminator.h +++ b/metaprogramming/pack_discriminator.h @@ -22,8 +22,6 @@ namespace jni::metaprogramming { enum class PackType { NOT_CONTAINER, TYPES, - AUTO, - AUTO_REF, CONST_AUTO_REF, }; @@ -41,16 +39,6 @@ struct PackDiscrimator { static constexpr PackType val = PackType::TYPES; }; - template