#ifndef ENTT_CORE_TUPLE_HPP #define ENTT_CORE_TUPLE_HPP #include #include #include #include "../config/config.h" namespace entt { /** * @brief Utility function to unwrap tuples of a single element. * @tparam Type Tuple type of any sizes. * @param value A tuple object of the given type. * @return The tuple itself if it contains more than one element, the first * element otherwise. */ template constexpr decltype(auto) unwrap_tuple(Type &&value) ENTT_NOEXCEPT { if constexpr(std::tuple_size_v> == 1u) { return std::get<0>(std::forward(value)); } else { return std::forward(value); } } } // namespace entt #endif