type traits:
* unpack_as_t -> unpack_as_type * unpack_as_v -> unpack_as_value
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user