std.stream.EndianStream ...
nescire
chrysme at gmail.com
Wed Feb 7 17:28:30 PST 2007
I have trouble understanding this compiler error I ran into while using the std.stream.EndianStream class.
When trying to compile:
EndianStream es = new EndianStream( new MemoryStream() );
ubyte b;
es.read( b );
dmd gives the error:
function std.stream.EndianStream.read called with argument types:
(ubyte)
matches both:
std.stream.EndianStream.read(short)
and:
std.stream.EndianStream.read(dchar)
Which seems to suggest the EndianStream class does not have a void read( out ubyte ) method, even though it should inherit it from FilterStream.
And the following code compiles:
EndianStream es = new EndianStream( new MemoryStream() );
ubyte b;
(cast(InputStream) es).read( b );
Could someone explain? Am I missing something obvious, or is it a compiler bug?
nescire
More information about the Digitalmars-d-learn
mailing list