boost array problems.
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
----- 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
Thanks that works.
On 8/5/07, "JOAQUIN LOPEZ MU?Z"
----- Mensaje original ----- De: chun ping wang
Fecha: Domingo, Agosto 5, 2007 7:09 am Asunto: [Boost-users] boost array problems. Para: boost-users@lists.boost.org, solutions@josuttis.com 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 _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Thanks that works.
Buy why that works?
Max
On 8/5/07, "JOAQUIN LOPEZ MU?Z"
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 _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
LoadCom
Thanks that works. Buy why that works? Max
On 8/5/07, "JOAQUIN LOPEZ MU?Z"
wrote: Use an added level of brace enclosing: {{ {"Chun", "Wang", 1441}, {"Chia", "Wang", 1443}, {"Ta", "Wang", 1445} }}; [...]
boost::array
Thanks. It's quite clear to me now.
Max
LoadCom
Thanks that works. ? Buy why that works? ? Max
On 8/5/07, "JOAQUIN LOPEZ MU?Z"
wrote: Use an added level of brace enclosing: {{ {"Chun", "Wang", 1441}, {"Chia", "Wang", 1443}, {"Ta", "Wang", 1445} }}; [...]
boost::array
participants (4)
-
"JOAQUIN LOPEZ MU?Z"
-
chun ping wang
-
Joaquin M Lopez Munoz
-
LoadCom