cppfront
cppfront copied to clipboard
feat: allow template specialization
Resolves #467. Partially addresses #387 (https://github.com/hsutter/cppfront/issues/387#template-argument-list).
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.
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.