Thanks that works.
----- Mensaje original -----
De: chun ping wang <cablepuff@gmail.com>
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<People, 3> = {
> {"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