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,
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(
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
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.
Correction: redefining in the *subclass*. Silly me.
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
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.
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.
}
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
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
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
11 matches
Mail list logo