digitalmars.D - Why is !() need with default template arguments
- Jacob Carlborg (6/6) May 19 2009 If I have a class like this:
- Jeremie Pelletier (2/13) May 19 2009 I think it is so the parser knows how to make the difference between the...
- Lars T. Kyllingstad (3/19) May 20 2009 Can you do anything with a template except instantiate it?
- Daniel Keep (3/6) May 20 2009 Pass it to another template as an alias argument.
- Tim Matthews (4/6) May 20 2009 Can you explain a bit more on this? function templates dont require this...
- Jeremie Pelletier (2/13) May 20 2009 Oh yeah you are right, it has already been filed as a bug.
If I have a class like this: class Class (T = int) {} Then why can't I use it like this: auto c = new C; I have to do this: auto c = new C!();
May 19 2009
Jacob Carlborg Wrote:If I have a class like this: class Class (T = int) {} Then why can't I use it like this: auto c = new C; I have to do this: auto c = new C!();I think it is so the parser knows how to make the difference between the template symbol and an instance symbol.
May 19 2009
Jeremie Pelletier wrote:Jacob Carlborg Wrote:Can you do anything with a template except instantiate it? -LarsIf I have a class like this: class Class (T = int) {} Then why can't I use it like this: auto c = new C; I have to do this: auto c = new C!();I think it is so the parser knows how to make the difference between the template symbol and an instance symbol.
May 20 2009
Lars T. Kyllingstad wrote:Can you do anything with a template except instantiate it? -LarsPass it to another template as an alias argument. -- Daniel
May 20 2009
On Wed, 20 May 2009 15:01:44 +1200, Jeremie Pelletier <jeremiep gmail.com> wrote:I think it is so the parser knows how to make the difference between the template symbol and an instance symbol.Can you explain a bit more on this? function templates dont require this by the way and I didn't think a template could ever be 'newed'
May 20 2009
Tim Matthews Wrote:On Wed, 20 May 2009 15:01:44 +1200, Jeremie Pelletier <jeremiep gmail.com> wrote:Oh yeah you are right, it has already been filed as a bug.I think it is so the parser knows how to make the difference between the template symbol and an instance symbol.Can you explain a bit more on this? function templates dont require this by the way and I didn't think a template could ever be 'newed'
May 20 2009