vector instantiation

Jaap Haitsma jaap_haitsma@yahoo.com
Sat Apr 19 15:12:00 GMT 2003


Hi Andrey,

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

Jaap 
--- "Andrey R. Urazov" <coola@ngs.ru> wrote:
> Hello,
> 
> Concerning the problem of instantiation of STL
> vector with the template
> parameter size of array. Sorry, but I forgot to
> include the program code
> in my posting. Here it is:
> 
> #include <vector>
> 
> using namespace std;
> 
> int main()
> {
>     vector<size_t[4]> v(10);
> 
>     return 0;
> }
> 
> 
> 
> 
> And compiling this with gcc-3.2.2 I get:
> 
> /usr/include/c++/3.2/bits/stl_vector.h: Dans
> constructor «
> std::vector<_Tp,
>    _Alloc>::vector(unsigned int) [with _Tp =
> size_t[4], _Alloc =
>    std::allocator<size_t[4]>] »:
> test.cpp:7:   instancié à partir d'ici
> /usr/include/c++/3.2/bits/stl_vector.h:342: ISO C++
> interdit le
> transtypage
>    vers un type tableau « size_t[4] »
> 
> 
> P.S. Just in case, please CC me since I'm not on the
> mailing list. Thank
> you.
> 
> Best regards,
> 	Andrey Urazov.
> 


__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com



More information about the Gcc-help mailing list