diff --git a/src/entt/core/compressed_pair.hpp b/src/entt/core/compressed_pair.hpp index f3e348f1f..236c7f2be 100644 --- a/src/entt/core/compressed_pair.hpp +++ b/src/entt/core/compressed_pair.hpp @@ -97,6 +97,11 @@ class compressed_pair final using second_base = internal::compressed_pair_element; public: + /*! @brief The type of the first element that the pair stores. */ + using first_type = First; + /*! @brief The type of the second element that the pair stores. */ + using second_type = Second; + /** * @brief Default constructor, conditionally enabled. * @@ -105,7 +110,7 @@ public: * * @tparam Dummy Dummy template parameter used for internal purposes. */ - template && std::is_default_constructible_v>> + template && std::is_default_constructible_v>> constexpr compressed_pair() : first_base{}, second_base{} {} @@ -164,12 +169,12 @@ public: * @brief Returns the first element that a pair stores. * @return The first element that a pair stores. */ - [[nodiscard]] First &first() ENTT_NOEXCEPT { + [[nodiscard]] first_type &first() ENTT_NOEXCEPT { return static_cast(*this).get(); } /*! @copydoc first */ - [[nodiscard]] const First &first() const ENTT_NOEXCEPT { + [[nodiscard]] const first_type &first() const ENTT_NOEXCEPT { return static_cast(*this).get(); } @@ -177,12 +182,12 @@ public: * @brief Returns the second element that a pair stores. * @return The second element that a pair stores. */ - [[nodiscard]] Second &second() ENTT_NOEXCEPT { + [[nodiscard]] second_type &second() ENTT_NOEXCEPT { return static_cast(*this).get(); } /*! @copydoc second */ - [[nodiscard]] const Second &second() const ENTT_NOEXCEPT { + [[nodiscard]] const second_type &second() const ENTT_NOEXCEPT { return static_cast(*this).get(); }