Afficher un message
Vieux 07/12/2007, 17h02   #2
Pete Becker
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: std::list of C-style arrays

On 2007-12-07 10:50:11 -0500, Spoon <root@localhost> said:

>
> Could someone explain why the following code is illegal?
> (I'm trying to use a list of (C-style) arrays.)


Because arrays are neither copy constructible nor assignable.

>
>
> Do I have to wrap the array in a struct?


Yes. Or, if you have TR1, use std::tr1::array, a template that defines
a fixed-size array that's copy constructible and assignable. It's also
slated for C++0x.

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)

  Réponse avec citation
 
Page generated in 0,04937 seconds with 9 queries