Jump to page: 1 2
Thread overview
[Issue 2596] New: Variadic constructors don't compile
Jan 21, 2009
d-bugmail
Jan 21, 2009
d-bugmail
Jan 21, 2009
d-bugmail
Jan 23, 2009
d-bugmail
Mar 16, 2009
d-bugmail
Mar 16, 2009
d-bugmail
Mar 17, 2009
d-bugmail
Mar 17, 2009
d-bugmail
Mar 17, 2009
d-bugmail
Mar 17, 2009
d-bugmail
Apr 01, 2009
d-bugmail
January 21, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2596

           Summary: Variadic constructors don't compile
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: andrei@metalanguage.com


The following code doesn't compile:

struct S
{
    this(T...)(T args)
    {
    }
}


-- 

January 21, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2596





------- Comment #1 from 2korden@gmail.com  2009-01-21 01:19 -------
S s = S();

What should be called - a default ctor or S.this() with empty tuple?


-- 

January 21, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2596





------- Comment #2 from andrei@metalanguage.com  2009-01-21 09:13 -------
(In reply to comment #1)
> S s = S();
> 
> What should be called - a default ctor or S.this() with empty tuple?
> 

Good question. Today that must be the default ctor because any struct must have a default constructor that doesn't execute user code.


-- 

January 23, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2596


smjg@iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg@iname.com




------- Comment #3 from smjg@iname.com  2009-01-22 19:49 -------
(In reply to comment #1)
> S s = S();
> 
> What should be called - a default ctor or S.this() with empty tuple?

The two would be one and the same.


-- 

March 16, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2596





------- Comment #4 from bugzilla@digitalmars.com  2009-03-16 18:44 -------
It isn't variadic constructors, it's any constructor templates.


-- 

March 16, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2596





------- Comment #5 from jarrett.billingsley@gmail.com  2009-03-16 18:56 -------
(In reply to comment #4)
> It isn't variadic constructors, it's any constructor templates.
> 

Why?  Ctors are not virtual; why can't they be templated?


-- 

March 17, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2596





------- Comment #6 from 2korden@gmail.com  2009-03-16 19:07 -------
(In reply to comment #5)
> (In reply to comment #4)
> > It isn't variadic constructors, it's any constructor templates.
> > 
> 
> Why?  Ctors are not virtual; why can't they be templated?
> 

Walter didn't say it is impossible, he merely pointed out that the case is not a variadic constructor, but a /variadic template/ constructor, I believe.


-- 

March 17, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2596





------- Comment #7 from jarrett.billingsley@gmail.com  2009-03-16 19:48 -------
> 
> Walter didn't say it is impossible, he merely pointed out that the case is not a variadic constructor, but a /variadic template/ constructor, I believe.
> 

I didn't say that he said that it was impossible ;)  I asked "why can't ctors be templated" as in "why is it not possible now" instead of "why is it not possible".


-- 

March 17, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2596





------- Comment #8 from 2korden@gmail.com  2009-03-16 19:59 -------
(In reply to comment #7)
> > 
> > Walter didn't say it is impossible, he merely pointed out that the case is not a variadic constructor, but a /variadic template/ constructor, I believe.
> > 
> 
> I didn't say that he said that it was impossible ;)  I asked "why can't ctors be templated" as in "why is it not possible now" instead of "why is it not possible".
> 

Well, ahem... It's a bug (or rather a missing functionality), that's why this
report is here :)


-- 

March 17, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2596





------- Comment #9 from jarrett.billingsley@gmail.com  2009-03-16 20:46 -------
(In reply to comment #8)
> 
> Well, ahem... It's a bug (or rather a missing functionality), that's why this
> report is here :)
> 

Sure, and I'm just trying to provoke conversation about the issue with the language designer.


-- 

« First   ‹ Prev
1 2