cmoon::meta::type_list<Types...>::index





template<typename T>
[[nodiscard]] static constexpr index_type index() noexcept;    


(1)

Returns the index of type T. Any program calling index() with a type T that is not in the type_list is ill-formed.

Parameters

(none)

Return value

The index of type T from the type_list.

Exceptions

This function never throws exceptions

Complexity

Constant.

Example



import cmoon.meta;

int main()
{
    using tl = cmoon::meta::type_list<int, float, char, int>;

    static_assert(tl::index<char>() == 2);
}