@@ -417,6 +417,55 @@ static_assert(size_of<std_array<const volatile std_array<std_array<uint32_t, 42>
417417static_assert (size_of<std_array<std_array<const volatile std_array<uint32_t , 42 >, 24 >, 8 >>() == sizeof (uint32_t ) * 42 * 24 * 8 );
418418static_assert (size_of<const volatile std_array<const volatile std_array<const volatile std_array<uint32_t , 42 >, 24 >, 8 >&>() == sizeof (uint32_t ) * 42 * 24 * 8 );
419419
420+
421+ // std::tuple decay elements.
422+ // ----------------------------------------------------------------------------
423+ // is_same_type decays individual types (but not tuple elements).
424+
425+ using test_tuple = std::tuple<int &, bool &&, const std::string&>;
426+ static_assert ( is_same_type<decay_tuple<test_tuple>, decay_tuple<test_tuple>>);
427+ static_assert (!is_same_type<test_tuple, decay_tuple<test_tuple>>);
428+ static_assert (!is_same_type<decay_tuple<test_tuple>, test_tuple>);
429+
430+ static_assert (!std::is_same_v<std::tuple_element<0 , test_tuple>::type, int >);
431+ static_assert (!std::is_same_v<std::tuple_element<1 , test_tuple>::type, bool >);
432+ static_assert (!std::is_same_v<std::tuple_element<2 , test_tuple>::type, std::string>);
433+
434+ static_assert (!std::is_same_v<std::tuple_element<0 , test_tuple>::type, const int >);
435+ static_assert (!std::is_same_v<std::tuple_element<1 , test_tuple>::type, const bool >);
436+ static_assert (!std::is_same_v<std::tuple_element<2 , test_tuple>::type, const std::string>);
437+
438+ static_assert ( std::is_same_v<std::tuple_element<0 , test_tuple>::type, int &>);
439+ static_assert (!std::is_same_v<std::tuple_element<1 , test_tuple>::type, bool &>);
440+ static_assert (!std::is_same_v<std::tuple_element<2 , test_tuple>::type, std::string&>);
441+
442+ static_assert (!std::is_same_v<std::tuple_element<0 , test_tuple>::type, int &&>);
443+ static_assert ( std::is_same_v<std::tuple_element<1 , test_tuple>::type, bool &&>);
444+ static_assert (!std::is_same_v<std::tuple_element<2 , test_tuple>::type, std::string&&>);
445+
446+ using normal_test_tuple = std::tuple<int , bool , std::string>;
447+ using decayed_test_tuple = decay_tuple<test_tuple>::type;
448+ static_assert (is_same_type<normal_test_tuple, decayed_test_tuple>);
449+
450+ static_assert (std::is_same_v<std::tuple_element<0 , decayed_test_tuple>::type, int >);
451+ static_assert (std::is_same_v<std::tuple_element<1 , decayed_test_tuple>::type, bool >);
452+ static_assert (std::is_same_v<std::tuple_element<2 , decayed_test_tuple>::type, std::string>);
453+
454+ static_assert (!std::is_same_v<std::tuple_element<0 , decayed_test_tuple>::type, const int >);
455+ static_assert (!std::is_same_v<std::tuple_element<1 , decayed_test_tuple>::type, const bool >);
456+ static_assert (!std::is_same_v<std::tuple_element<2 , decayed_test_tuple>::type, const std::string>);
457+
458+ static_assert (!std::is_same_v<std::tuple_element<0 , decayed_test_tuple>::type, int &>);
459+ static_assert (!std::is_same_v<std::tuple_element<1 , decayed_test_tuple>::type, bool &>);
460+ static_assert (!std::is_same_v<std::tuple_element<2 , decayed_test_tuple>::type, std::string&>);
461+
462+ static_assert (!std::is_same_v<std::tuple_element<0 , decayed_test_tuple>::type, int &&>);
463+ static_assert (!std::is_same_v<std::tuple_element<1 , decayed_test_tuple>::type, bool &&>);
464+ static_assert (!std::is_same_v<std::tuple_element<2 , decayed_test_tuple>::type, std::string&&>);
465+
466+ // is_uintx
467+ // ----------------------------------------------------------------------------
468+
420469static_assert (is_uintx<uint5_t >);
421470static_assert (is_uintx<uint11_t >);
422471static_assert (is_uintx<uint48_t >);
0 commit comments