This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: vector instantiation
- From: drkm <darkman_spam at yahoo dot fr>
- To: gcc-help at gnu dot org
- Date: Mon, 21 Apr 2003 18:22:35 +0200 (CEST)
- Subject: Re: vector instantiation
--- "Andrey R. Urazov" <coola at ngs dot ru> a écrit :
> > I'm not sure if it is allowed to put arrays as a
> > parameter of the template. Why don't you make a class
> > or a struct which contains this array of 4 size_t's
> Because an array of 4 elements is just a particular case. In general
> there are n elements and n is known at compile time.
What do you think about
template < typename T , size_t N >
struct MyWrapper
{
T myArray[ N ] ;
} ;
std::vector< MyWrapper< size_t , 4 > >
the_array ;
?
But why do you not want the following :
std::vector< std::vector< size_t > >
the_array ;
or
std::vector< boost::array< size_t , 4 > >
the_array ;
?
Best regards,
--drkm
___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com