cppfront icon indicating copy to clipboard operation
cppfront copied to clipboard

feat: allow template specialization

Open JohelEGP opened this issue 2 years ago • 3 comments

Resolves #467. Partially addresses #387 (https://github.com/hsutter/cppfront/issues/387#template-argument-list).

JohelEGP avatar Aug 17 '23 21:08 JohelEGP

From https://github.com/hsutter/cppfront/issues/467#issuecomment-1682813870:

There's an unsolvable ambiguity at the grammar level. You can't make a full specialization that uses a non-templated metafunction, since the <> is part of the metafunction's identifier.

t: @struct <> type<i32> type = { } // error: `struct<>` is not a known metafunction.

JohelEGP avatar Aug 17 '23 21:08 JohelEGP

As a workaround, maybe we can just do without the redundant <>. type<…> already introduces an specialization, and if there's no template-parameter-declaration-list, we can make it so that it's a full specialization.

JohelEGP avatar Aug 17 '23 21:08 JohelEGP