The Final(ize) Challenge

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue May 19 08:46:05 PDT 2009


Daniel Keep wrote:
> 
> Jarrett Billingsley wrote:
>> On Mon, May 18, 2009 at 1:57 PM, Jarrett Billingsley
>> <jarrett.billingsley at gmail.com> wrote:
>>> On Mon, May 18, 2009 at 1:56 PM, Bill Baxter <wbaxter at gmail.com> wrote:
>>>> When did templated constructors start being allowed?!  I see nothing
>>>> about it in the change log.
>>> I was about to say the same thing.
>>>
>> It doesn't work.  Let me guess: 2.031.  :P
> 
> It's hardly fair to issue a challenge which can only be completed [1]
> with an unreleased compiler only you have seen.

I don't have 2.031 and I don't know whether it will fix the template 
constructor bug.

> Actually, that *still* isn't going to cut it: it won't handle ref or out
> arguments correctly.  I'm not sure what it'd do with scope.
> 
> We *really* need to come up with a sane solution to generalising on
> storage class.  Every time I have to generate functions, they make my
> life a complete pain in the arse.  The only solution I've found is this
> hideous hack that parses ParameterTuple!(T).stringof and builds an array
> of enums... yech.

It's much easier to parse ParameterTuple!(T)[n].stringof. If it starts 
with "ref "/"out " then it's a ref/out.

> ... and yeah, when were you gonna tell us about templated ctors?!
> 
>   -- Daniel
> 
> 
> [1] Qualification because I know if I don't, I'll regret it: I'm
> assuming the next compiler does support templated ctors (as otherwise
> your "it's easy" statement is bogus) and that this is the only way of
> solving the problem (I can't think of any other way of doing it.)

You could for now comment out the constructor and leave it until the bug 
is fixed.


Andrei



More information about the Digitalmars-d mailing list