This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: unification bug
- To: Mike Stump <mrs at kithrup dot com>
- Subject: Re: unification bug
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 09 May 1998 17:23:45 -0300
- Cc: egcs-bugs at cygnus dot com
- References: <199805090836.BAA12312@kithrup.com>
Mike Stump <mrs@kithrup.com> writes:
> template<class T, int i1, int i2>
> inline void tsqsort (T b[i1][i2], int (*cmp)(const T*, const T*));
^^^^^
Remember that this is indistinguishable from:
template<class T, int i1, int i2>
inline void tsqsort (T (*b)[i2], int (*cmp)(const T*, const T*));
^^^^
So there's no way for i1 to be deduced. In order to be able to deduce
the size of the first dimension of an array, you must pass it by
reference:
template<class T, int i1, int i2>
inline void tsqsort (T (&b)[i1][i2], int (*cmp)(const T*, const T*));
^^^^
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil