This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: eb42.C
- To: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Subject: Re: eb42.C
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 28 May 1998 22:57:39 -0300
- Cc: egcs-patches at cygnus dot com
- References: <199805282232.AAA00249@mira.isdn.cs.tu-berlin.de>
Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> writes:
> template <class T >
> inline bool compare(const Expr<T> a, const Expr<T> b){ return true; };
> sort( a.begin(), a.end(), compare );
> Is the compiler really required to determine the parameter of compare?
No, it cannot be deduced because the types of the iterators and the
compare objects are unrelated in the `sort' template function
declaration. Thus, template arguments for compare must be explicitly
specified.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil