g++: change in behaviour since gcc-2.95.2

Martin Reinecke martin@MPA-Garching.MPG.DE
Tue Dec 21 02:25:00 GMT 1999


Consider the following code snippet:

class MSG_STREAM
  {
  public:
    template<typename T> MSG_STREAM &operator<< (const T &data) {}
  };

MSG_STREAM *simple_manip (MSG_STREAM &blah) {}

int main()
  {
  MSG_STREAM foo;
  foo << 5 << simple_manip;
  }

gcc 2.95.2 compiles this without complaints, while the current CVS version says

test.cc: In function `int main ()':
test.cc:12: no match for `MSG_STREAM & << MSG_STREAM *(&) (MSG_STREAM &)'

Is this new behaviour according to the standard? If so, could you please point
me to some information why pointers to functions cannot be used as template
parameter types?

Thanks in advance,
  Martin


More information about the Gcc mailing list