Templates do maybe not need to be that slow (no promises)

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 9 08:28:55 PDT 2016


On Friday, 9 September 2016 at 15:08:26 UTC, Iakh wrote:
> On Friday, 9 September 2016 at 07:56:04 UTC, Stefan Koch wrote:
>
> I was thinking on adding "opaque" attribute for template 
> arguments
> to force template to forget some information about type.
> E.g if you use
>
> class A(opaque T) {...}
>
> you can use only pointers/references to T.
>
> Probably compiler could determine it by itself is type used
> as opaque or not.

you could use void* in this case and would not need a template at 
all.


More information about the Digitalmars-d mailing list