template operator instantiation problem (istream_iterator)

Yotam Medini yotam@blueneptune.com
Sun Oct 19 02:29:00 GMT 1997


It seems that the operator
  " istream_iterator ==  istream_iterator "
has instantiation problems.

Also when trying to manually instantiate, 
an incompatible symbol is made. May be it's related to the same problem.
-- yotam
------------------------------------------------------------------------
pentini:379> egcs++ -v
Reading specs from /home/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.13/specs
gcc version egcs-2.90.13 971016 (gcc2-970802 experimental)
pentini:380> cat egbug4.cc
#include <iterator>

#ifdef INST
 template bool 
  operator==(istream_iterator<float, int> const &, 
             istream_iterator<float, int> const &);
#endif

int
main(int, char**)
{
   istream_iterator<float, int>  i0, i1;
   bool  eq = (i0 == i1);
   return(!eq);
}
pentini:381> egcs++ -o egbug4 egbug4.cc
/tmp/cca260841.o: In function `main':
/tmp/cca260841.o(.text+0x27): undefined reference to `operator==(istream_iterator<float, int> const &, istream_iterator<float, int> const &)'
collect2: ld returned 1 exit status
pentini:382> egcs++ -c -DINST egbug4.cc
pentini:383> nm egbug4.o | egcs++filt | grep istream_iterator
         U operator==(istream_iterator<float, int> const &, istream_iterator<float, int> const &)
00000048 T bool operator==<float, int>(istream_iterator<float, int> const &, istream_iterator<float, int> const &)
00000000 W istream_iterator<float, int>::istream_iterator(void)
pentini:384> 



More information about the Gcc-bugs mailing list