Re: temp file

2012-02-18 Thread bioinfornatics
Le samedi 18 février 2012 à 12:58 +0400, Denis Shelomovskij a écrit : 18.02.2012 6:59, bioinfornatics пишет: hi, when i try to use tmpfile from std.stdio i get this error char 0x00ad not allowed in identifier I use dmdfe 2.058, i do just: File tmp = tmpfile(); Full source,

Re: temp file

2012-02-18 Thread HeiHon
On Saturday, 18 February 2012 at 10:19:06 UTC, bioinfornatics wrote: import std.string; import std.stdio; void main( ){ File tmp = File.tmpfile(); tmp.writeln( ok ); tmp.writeln( D is Fun ); writefln( fileName: %s, tmp.name ); foreach( line; tmp.byLine() ) writefln(

Template Inheritance

2012-02-18 Thread %u
I've been working on porting an old D library to D2, and I'm running into a nasty issue with templates and inheritance. I've got a base class like this: class Reader { void get(T)(ref T[] buffer); } and a subclass like this: class SubReader { void get()(SomeClass param); } The problem

Re: Template Inheritance

2012-02-18 Thread %u
In the interim, I'm just redefining the template in the base class, but that's a really annoying hack to have to perform every single time I have to make a new form of the template.

Re: Template Inheritance

2012-02-18 Thread %u
Correction: redefining in the *subclass*. Silly me.

Re: Template Inheritance

2012-02-18 Thread Jonathan M Davis
On Sunday, February 19, 2012 00:55:59 %u wrote: I've been working on porting an old D library to D2, and I'm running into a nasty issue with templates and inheritance. I've got a base class like this: class Reader { void get(T)(ref T[] buffer); } and a subclass like this: class

Re: Template Inheritance

2012-02-18 Thread %u
Thanks! I guess I'll just have to live with redefining the functions, do some sort of interface/mixin thing, or change the class interface. It makes sense that template functions aren't virtual (how are you supposed to deal with vtables?), but I wish that at least an alias declaration could work.

Re: Template Inheritance

2012-02-18 Thread %u
I think I got it! This seems to work: class Derived { //Pulls in all the template forms in the base class template get(args ...) { alias Base.get!args get; } //Create new versions of get() here. }

Re: Template Inheritance

2012-02-18 Thread Jonathan M Davis
On Sunday, February 19, 2012 01:17:42 %u wrote: Thanks! I guess I'll just have to live with redefining the functions, do some sort of interface/mixin thing, or change the class interface. It makes sense that template functions aren't virtual (how are you supposed to deal with vtables?), but I

Re: Template Inheritance

2012-02-18 Thread Jonathan M Davis
On Sunday, February 19, 2012 01:23:13 %u wrote: I think I got it! This seems to work: class Derived { //Pulls in all the template forms in the base class template get(args ...) { alias Base.get!args get; } //Create new versions of get() here. } That seems like

Re: Template Inheritance

2012-02-18 Thread Timon Gehr
On 02/19/2012 01:55 AM, %u wrote: I've been working on porting an old D library to D2, and I'm running into a nasty issue with templates and inheritance. I've got a base class like this: class Reader { void get(T)(ref T[] buffer); } and a subclass like this: class SubReader { void