This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

About endl...


Hi,

I would like to know whether this is a bug or a feature. I have found that the
following program that used to compile with gcc 2.95 doesn't compile anymore
with gcc 3 (libstdc++ 3).

#include <iostream>
using namespace std;

template <class T>
void output(T val) {
   cout << val;
}

int main() {
   output(endl);
}

The error message I get is:
output.cc: In function `int main()':
output.cc:11: no matching function for call to `output (<unknown type>)'

The same way, "typeid(endl)" doesn't compile either. This behaviour is very
annoying because it breaks some template functions. Is there anything that can
be done about that?

        Jean-Marc

-- 
Jean-Marc Valin
Universite de Sherbrooke - Genie Electrique
valj01@gel.usherb.ca

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]