I would expect these lines to compile:
static_assert(type_pack_index_of<int, decltype(extract_type_pack<TypePack<IndexType<23, int>>>)> == 0ul);
static_assert(type_pack_index_of<int, ExtractTypePack<TypePack<IndexType<23, int>>>> == 0ul);
But they don't. Because the results of extract_type_pack and ExtractTypePack are marked const and thus are not matched to the correct declaration of indexed_type_pack_index_of.
To check constness, compile this and see the warnings:
template<class... Ts>
struct [[deprecated]] print_types;
using A = print_types<ExtractTypePack<TypePack<IndexType<23, int>>>>;
using B = print_types<decltype(extract_type_pack<TypePack<IndexType<23, int>>>)>;
I would expect these lines to compile:
But they don't. Because the results of
extract_type_packandExtractTypePackare markedconstand thus are not matched to the correct declaration ofindexed_type_pack_index_of.To check constness, compile this and see the warnings: