www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2596] New: Variadic constructors don't compile

reply d-bugmail puremagic.com writes:
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)
    {
    }
}


-- 
Jan 20 2009
next sibling parent d-bugmail puremagic.com writes:
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?


-- 
Jan 20 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
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. --
Jan 21 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
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. --
Jan 22 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
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.


-- 
Mar 16 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
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? --
Mar 16 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
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. --
Mar 16 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
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". --
Mar 16 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
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 :) --
Mar 16 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
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. --
Mar 16 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2596


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #10 from bugzilla digitalmars.com  2009-04-01 13:52 -------
Fixed DMD 2.027


-- 
Apr 01 2009