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






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







 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






 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






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







 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








 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






 
 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







 
 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







 
 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





Fixed DMD 2.027


-- 
Apr 01 2009