This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/8567: std::endl is of unknown type when overloading operator<<(repeat in case attachment didnt work)
- From: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- To: Jason Stanek <jstanek at iastate dot edu>
- Cc: gcc-bugs at gcc dot gnu dot org, <jstanek at vrac dot iastate dot edu>, <gcc-gnats at gcc dot gnu dot org>
- Date: Fri, 15 Nov 2002 10:06:47 -0600 (CST)
- Subject: Re: c++/8567: std::endl is of unknown type when overloading operator<<(repeat in case attachment didnt work)
> Isnt there a way to specify a default template type?
>
> So instead of declaring endl as a pure template, it has a default type in
> the case that you dont specify one.
>
> Something like this:
>
> namespace std {
> template <typename T=int> T& endl (T&);
> };
Default template arguments are only possible for classes, not for function
templates.
Regards
Wolfgang
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth