Dynamic templated virtuals - I still often want them
Steven Schveighoffer
schveiguy at gmail.com
Wed Jul 29 13:55:27 UTC 2020
On 7/29/20 9:37 AM, Arafel wrote:
> You could of course special-case the syntax to disable these cases, but
> for the users it would be an unexpected outlier in how the templates work.
I think it's a 2-stage process. 1) instantiate the template with the
type ONLY. If it can't be instantiated, then it's not valid. 2) check
for normal overriding rules. If it cannot override the base function,
then it's an error.
One difference might have to be attribute inference, as you may not want
the template to infer more restrictive attributes than you need, and
there is no way to say e.g. @gc.
-Steve
More information about the Digitalmars-d
mailing list