Take as an example this code to determine the length of a type list:
template <class... Types>
class type_list {};
template <class TypeList>
struct type_list_length; // <---
template <template <class...> class type_list, class... Types>
struct type_list_length<TypeList<Types...>>
{
static constexpr std::size_t value = sizeof...(Types);
};
Why do we need the marked declaration? I tried to compile the code without it in several compilers but are always getting errors.
Aucun commentaire:
Enregistrer un commentaire