C++ bug with std::copy and std::pair

Paul Edwards paul@jp-solutions.net
Sun Nov 20 16:28:00 GMT 2005


Version information:

paul@jay ~ $ g++ -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/specs
Configured with: /var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3.6
--includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/info
--with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include/g++-v3 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libgcj --enable-languages=c,c++,f77 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)

I also found the same problem with a friends fedora core 4 with gcc 4.

I have attached a cpp file that (I believe) should compile (and does on
Borland c++).  It is the copy at the end that causes a problem - the
while loop is simply doing the same as what the copy should do (just to
show I did the operator<< properly).  Copy works for other cases (ints,
floats, etc) and even for my own structs too.  I'm just not sure why it
complains about the operator<< function for a std::pair.

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pair.cpp
Type: text/x-c++src
Size: 745 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20051120/0dfd5717/attachment.bin>


More information about the Gcc-bugs mailing list