Miscellaneous question regarding std.container?

Too Embarrassed To Say kheaser at eapl.org
Sat Nov 3 11:38:13 PDT 2012


The std.container starts off with container primitives. Does this 
mean that all containers should support all these primitives?  
Because I could never get c.length to work for a simple SList.

Are there formal definitions for  U and Stuff like  in (U)(U[] 
values...) and (string op, Stuff)(Stuff stuff);


struct SList(T);   //  Implements a simple and fast singly-linked 
list.

Since SList is a structure and in the excellent book by 
Andrei[A..u], he says for structure constructors (7.1.3.1) 
“…the compiler always defines the no-arguments constructor”.

This being the case shouldn’t one of the following compile?

SList(int) s1;
SList() s2;
SList s3;
auto s4 = SList;
auto s5 = SList();
auto s6 = SList(int);


And how does the std.array differ from the Array in 
std.container?  Is the std.array array a class while the 
std.container array a structure?



More information about the Digitalmars-d-learn mailing list