5 Aug
2007
5 Aug
'07
8:30 a.m.
----- Mensaje original -----
De: chun ping wang
Hi I have a
struct People { const char* fname_; const char* lname_; unsigned int id; }
I want to create an array of 3 people.
boost::array
= { {"Chun", "Wang", 1441}, {"Chia", "Wang", 1443}, {"Ta", "Wang", 1445} }; I get a compile time error too many initializer.
Use an added level of brace enclosing: {{ {"Chun", "Wang", 1441}, {"Chia", "Wang", 1443}, {"Ta", "Wang", 1445} }}; See http://boost.org/doc/html/array/rationale.html for more details. HTH, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo