Re: Instantiating a class with range template parameter

2016-09-08 Thread Jon Degenhardt via Digitalmars-d-learn
On Thursday, 8 September 2016 at 08:44:54 UTC, Lodovico Giaretta wrote: On Thursday, 8 September 2016 at 08:20:49 UTC, Jon Degenhardt wrote: [snip] I think that auto x = new Derived!(typeof(stdout.lockingTextWriter()))(); // note the parenthesis should work. But usually, you save the

Re: Instantiating a class with range template parameter

2016-09-08 Thread Lodovico Giaretta via Digitalmars-d-learn
On Thursday, 8 September 2016 at 08:20:49 UTC, Jon Degenhardt wrote: I've been generalizing output routines by passing an OutputRange as an argument. This gets interesting when the output routine is an virtual function. Virtual functions cannot be templates, so instead the template parameters

Instantiating a class with range template parameter

2016-09-08 Thread Jon Degenhardt via Digitalmars-d-learn
I've been generalizing output routines by passing an OutputRange as an argument. This gets interesting when the output routine is an virtual function. Virtual functions cannot be templates, so instead the template parameters need to be part of class definition and specified when instantiating