diff --git a/README.md b/README.md index 12514d4..161a82e 100644 --- a/README.md +++ b/README.md @@ -122,13 +122,13 @@ public: template < typename T, size_t Size > class vec final : public vec_base { public: - using value_type = T; + using component_type = T; - using pointer = value_type*; - using const_pointer = const value_type*; + using pointer = component_type*; + using const_pointer = const component_type*; - using reference = value_type&; - using const_reference = const value_type&; + using reference = component_type&; + using const_reference = const component_type&; static constexpr size_t size = Size; diff --git a/headers/vmath.hpp/vmath_mat_fun.hpp b/headers/vmath.hpp/vmath_mat_fun.hpp index cbea454..4b182d1 100644 --- a/headers/vmath.hpp/vmath_mat_fun.hpp +++ b/headers/vmath.hpp/vmath_mat_fun.hpp @@ -21,7 +21,7 @@ namespace vmath_hpp::detail template < typename A, std::size_t Size, typename F, std::size_t... Is > [[nodiscard]] constexpr VMATH_HPP_FORCE_INLINE auto map_impl(F&& f, const mat& a, std::index_sequence) - -> mat>::value_type, Size> + -> mat>::component_type, Size> { return { f(a[Is])... }; } @@ -29,7 +29,7 @@ namespace vmath_hpp::detail template < typename A, typename B, std::size_t Size, typename F, std::size_t... Is > [[nodiscard]] constexpr VMATH_HPP_FORCE_INLINE auto zip_impl(F&& f, const mat& a, const mat& b, std::index_sequence) - -> mat, vec>::value_type, Size> + -> mat, vec>::component_type, Size> { return { f(a[Is], b[Is])... }; } @@ -37,7 +37,7 @@ namespace vmath_hpp::detail template < typename A, typename B, typename C, std::size_t Size, typename F, std::size_t... Is > [[nodiscard]] constexpr VMATH_HPP_FORCE_INLINE auto zip_impl(F&& f, const mat& a, const mat& b, const mat& c, std::index_sequence) - -> mat, vec, vec>::value_type, Size> + -> mat, vec, vec>::component_type, Size> { return { f(a[Is], b[Is], c[Is])... }; } @@ -65,7 +65,7 @@ namespace vmath_hpp::detail template < typename A, std::size_t Size, typename F > [[nodiscard]] constexpr VMATH_HPP_FORCE_INLINE auto map(F&& f, const mat& a) - -> mat>::value_type, Size> + -> mat>::component_type, Size> { return impl::map_impl(std::forward(f), a, std::make_index_sequence{}); } @@ -73,7 +73,7 @@ namespace vmath_hpp::detail template < typename A, typename B, std::size_t Size, typename F > [[nodiscard]] constexpr VMATH_HPP_FORCE_INLINE auto zip(F&& f, const mat& a, const mat& b) - -> mat, vec>::value_type, Size> + -> mat, vec>::component_type, Size> { return impl::zip_impl(std::forward(f), a, b, std::make_index_sequence{}); } @@ -81,7 +81,7 @@ namespace vmath_hpp::detail template < typename A, typename B, typename C, std::size_t Size, typename F > [[nodiscard]] constexpr VMATH_HPP_FORCE_INLINE auto zip(F&& f, const mat& a, const mat& b, const mat& c) - -> mat, vec, vec>::value_type, Size> + -> mat, vec, vec>::component_type, Size> { return impl::zip_impl(std::forward(f), a, b, c, std::make_index_sequence{}); } diff --git a/headers/vmath.hpp/vmath_vec.hpp b/headers/vmath.hpp/vmath_vec.hpp index bfd4346..f15d325 100644 --- a/headers/vmath.hpp/vmath_vec.hpp +++ b/headers/vmath.hpp/vmath_vec.hpp @@ -151,13 +151,13 @@ namespace vmath_hpp using self_type = vec; using base_type = detail::vec_base; public: - using value_type = T; + using component_type = T; - using pointer = value_type*; - using const_pointer = const value_type*; + using pointer = component_type*; + using const_pointer = const component_type*; - using reference = value_type&; - using const_reference = const value_type&; + using reference = component_type&; + using const_reference = const component_type&; static constexpr std::size_t size = Size; public: diff --git a/untests/vmath_ext_tests.cpp b/untests/vmath_ext_tests.cpp index 00e7c24..abee61b 100644 --- a/untests/vmath_ext_tests.cpp +++ b/untests/vmath_ext_tests.cpp @@ -101,7 +101,7 @@ TEST_CASE("vmath/ext") { { constexpr auto v = cast_to(float2{1.5f}); STATIC_REQUIRE(v == int2(1)); - STATIC_REQUIRE(std::is_same_v); + STATIC_REQUIRE(std::is_same_v); } { constexpr auto m = cast_to(float2x2{1.5f});