/// @ref gtx_structured_bindings /// @file glm/gtx/structured_bindings.hpp /// /// @defgroup gtx_structured_bindings GLM_GTX_structured_bindings /// @ingroup gtx /// /// Include to use the features of this extension. #pragma once // Dependency: #include "../glm.hpp" #include "../gtx/quaternion.hpp" #ifdef __cpp_structured_bindings #if __cpp_structured_bindings >= 201606L #include #include namespace std { template struct tuple_size> { static constexpr size_t value = L; }; template struct tuple_size> { static constexpr size_t value = C; }; template struct tuple_size> { static constexpr size_t value = 4; }; template struct tuple_element> { GLM_STATIC_ASSERT(I < L,"Index out of bounds"); typedef T type; }; template struct tuple_element> { GLM_STATIC_ASSERT(I < C, "Index out of bounds"); typedef glm::vec type; }; template struct tuple_element> { GLM_STATIC_ASSERT(I < 4, "Index out of bounds"); typedef T type; }; } #endif #endif #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_iteration is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." #elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTX_io extension included") #endif namespace glm { /// @addtogroup gtx_structured_bindings /// @{ template GLM_FUNC_DECL GLM_CONSTEXPR T& get(vec& v); template GLM_FUNC_DECL GLM_CONSTEXPR T const& get(vec const& v); template GLM_FUNC_DECL GLM_CONSTEXPR vec& get(mat& m); template GLM_FUNC_DECL GLM_CONSTEXPR vec const& get(mat const& m); template GLM_FUNC_DECL GLM_CONSTEXPR T& get(qua& q); template GLM_FUNC_DECL GLM_CONSTEXPR T const& get(qua const& q); #if GLM_HAS_RVALUE_REFERENCES template GLM_FUNC_DECL GLM_CONSTEXPR T get(vec const&& v); template GLM_FUNC_DECL GLM_CONSTEXPR vec get(mat const&& m); template GLM_FUNC_DECL GLM_CONSTEXPR T get(qua const&& q); #endif /// @} }//namespace glm #include "structured_bindings.inl"