SList of chars not possible?

They call me Mr. D kheaser at eapl.org
Thu Nov 1 15:18:41 PDT 2012


auto i = SList!int(1, 2, 3, 4, 5, 6, 7);

auto f = SList!float(1.1, 2.234, 3.21, 4.3, 5.001, 6.2, 7.0);

auto s = SList!string(["I", "Hello", "World"]);

auto c = SList!char('a', 'b' ,'c');  // doesn't compile, get the 
following

C:\D\dmd2\windows\bin\..\..\src\phobos\std\container.d(905): 
Error: template std.container.SList!(char).SList.insertFront does 
not match any function template
eclaration
C:\D\dmd2\windows\bin\..\..\src\phobos\std\container.d(1096): 
Error: template std.container.SList!(char).SList.insertFront 
cannot deduce template function from
argument types !()(char[])
Container.d(19): Error: template instance 
std.container.SList!(char).SList.__ctor!(char) error instantiating

auto c = SList!char(['a', 'b' ,'c']); // doesn't compile either.


Seems to me a Slist of char nodes should be pretty innocuous.


More information about the Digitalmars-d-learn mailing list