type traits:

* unpack_as_t -> unpack_as_type
* unpack_as_v -> unpack_as_value
This commit is contained in:
Michele Caini
2021-11-04 14:17:21 +01:00
parent 3dbe6c3902
commit a069764af1
2 changed files with 4 additions and 4 deletions

View File

@@ -78,7 +78,7 @@ inline constexpr std::size_t size_of_v = size_of<Type>::value;
* @tparam Type A type to repeat.
*/
template<typename Type, typename>
using unpack_as_t = Type;
using unpack_as_type = Type;
/**
* @brief Helper variable template to be used to _repeat_ the same value a
@@ -86,7 +86,7 @@ using unpack_as_t = Type;
* @tparam Value A value to repeat.
*/
template<auto Value, typename>
inline constexpr auto unpack_as_v = Value;
inline constexpr auto unpack_as_value = Value;
/**
* @brief Wraps a static constant.

View File

@@ -30,7 +30,7 @@ TEST(TypeTraits, SizeOf) {
TEST(TypeTraits, UnpackAsType) {
auto test = [](auto &&...args) {
return [](entt::unpack_as_t<int, decltype(args)>... value) {
return [](entt::unpack_as_type<int, decltype(args)>... value) {
return (value + ... + 0);
};
};
@@ -40,7 +40,7 @@ TEST(TypeTraits, UnpackAsType) {
TEST(TypeTraits, UnpackAsValue) {
auto test = [](auto &&...args) {
return (entt::unpack_as_v<2, decltype(args)> + ... + 0);
return (entt::unpack_as_value<2, decltype(args)> + ... + 0);
};
ASSERT_EQ(test('c', 42., true), 6);