Fun with templates

Marco Leise Marco.Leise at gmx.de
Sun Jul 7 04:08:00 PDT 2013


Am Sat, 6 Jul 2013 20:24:41 +1000
schrieb Manu <turkeyman at gmail.com>:

> On 6 July 2013 18:23, Namespace <rswhite4 at googlemail.com> wrote:
> 
> > That doesn't do what I want at all. The signature is still f(T) not
> >> f(Unqual!T).
> >>
> >
> > For non-const, const and immutable inout would do it.
> >
> > void f(T)(inout T var)
> >
> 
> Not if there's more than 1 argument, and 'inout T' is still not 'T'.

Hey, inout looks like a neat solution! And it only creates one
template instance no matter how many arguments of type
inout(T) you use!

-- 
Marco



More information about the Digitalmars-d mailing list