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]

Re: Partial ordering bug (?) in egcs


>>>>> "Thomas" == Thomas Kunert <kunert@physik.tu-dresden.de> writes:

    Thomas> Mark Mitchell wrote:
    >>  template<int N> class IndexPlaceholder { };
    >> 
    >> template<class T, int N> class Array { };
    >> 
    >> // #1 template<class T1, class T2> void max(const T1& a, const
    >> T2& b) { }
    >> 
    >> // #2 template<class T_numtype, int N_rank, int N_index> inline
    >> void max(const Array<T_numtype, N_rank>& array,
    >> IndexPlaceholder<N_index>) { }
    >> 
    
    Thomas> Unfortunately I don't have a copy of the FDIS, but the
    Thomas> Nov. 97 WP says in 14.5.5.2 [temp.func.order]:

    Thomas> `const T2&' is not supposed to be the the "same as" but an
    Thomas> "exact match" for `IndexPlaceholder<N_index>'.  In the
    Thomas> example above you can choose an appropriate T2.  Hence I
    Thomas> think #2 is more specialized than #1.

I don't see the distinction.  Are you proposing that, for example, 

  template <class T> void f(const T&);
  template <> void f(int);

is a legal specialization?  It's not, IMO.  But that would seem to be
the consequence of your suggestion.

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com


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