type_traits: updated choice utility (template variable)

This commit is contained in:
Michele Caini
2019-10-19 15:51:27 +02:00
parent 5ad4079dbf
commit 6a656a1b0a

View File

@@ -13,20 +13,28 @@ namespace entt {
/**
* @brief Utility class to disambiguate overloaded functions.
* @tparam N Current step.
* @tparam N Number of choices available.
*/
template<std::size_t N>
struct choice
struct choice_t
// Unfortunately, doxygen cannot parse such a construct.
/*! @cond TURN_OFF_DOXYGEN */
: choice<N-1>
: choice_t<N-1>
/*! @endcond TURN_OFF_DOXYGEN */
{};
/*! @copybrief choice */
/*! @copybrief choice_t */
template<>
struct choice<0> {};
struct choice_t<0> {};
/**
* @brief Variable template for the choice trick.
* @tparam N Number of choices available.
*/
template<std::size_t N>
constexpr choice_t<N> choice{};
/*! @brief A class to use to push around lists of types, nothing more. */