public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* vector instantiation
@ 2003-04-17  8:47 Andrey R. Urazov
  2003-04-17 11:55 ` Alex Vinokur
  0 siblings, 1 reply; 7+ messages in thread
From: Andrey R. Urazov @ 2003-04-17  8:47 UTC (permalink / raw)
  To: gcc-help

Hello,

I tried to declare vector with the template parameter of array and,
unfortunately, the compilation failed with the following error message
(I'm using gcc-3.2.2):

/usr/include/c++/3.2/bits/stl_vector.h: In constructor `std::vector<_Tp,
   _Alloc>::vector(unsigned int) [with _Tp = size_t[4], _Alloc =
   std::allocator<size_t[4]>]':
test.cpp:7:   instantiated from here
/usr/include/c++/3.2/bits/stl_vector.h:342: ISO C++ forbids casting to
an array
   type `size_t[4]'

I think this is incorrect behavior. But, of course, I may be wrong. Any
ideas? Is permitted to declare STL containers with the elements of
arrays in the C++ standard?

Best regards,
	Andrey Urazov.

^ permalink raw reply	[flat|nested] 7+ messages in thread
* vector instantiation
@ 2003-04-18 20:06 Andrey R. Urazov
  2003-04-19  8:44 ` Alex Vinokur
  2003-04-19 15:12 ` Jaap Haitsma
  0 siblings, 2 replies; 7+ messages in thread
From: Andrey R. Urazov @ 2003-04-18 20:06 UTC (permalink / raw)
  To: gcc-help

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-04-21 16:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-17  8:47 vector instantiation Andrey R. Urazov
2003-04-17 11:55 ` Alex Vinokur
2003-04-18 20:06 Andrey R. Urazov
2003-04-19  8:44 ` Alex Vinokur
2003-04-19 15:12 ` Jaap Haitsma
2003-04-21  8:11   ` Andrey R. Urazov
2003-04-21 16:24     ` drkm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).