Skip to content

ExtractTypePack does not return a TypePack #26

Description

@MaxMatti

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>>>)>;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions