This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



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