From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexandre Oliva To: rssh@grad.kiev.ua Cc: egcs@cygnus.com Subject: Re: [Q] about template specialization Date: Mon, 27 Apr 1998 00:33:00 -0000 Message-id: References: <354231E5.F2165C14@Shevchenko.Kiev.UA> X-SW-Source: 1998-04/msg01061.html Ruslan Shevchenko writes: > template inline > const K& default_key(const E&); > template inline > const T& default_key(const T& x) > virtual const K& get_key(const E& x) > { return default_key(x); } > I think that X::get_key must call specialization (i. e. second > definition) There's not such thing as partial specialization of a function templates. You have just overloaded `default_key' with two different template functions. In this case, you will always have to explicitly specify template arguments. Since you specify default_key, not just default_key, you are selecting the first definition. -- Alexandre Oliva mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org http://www.dcc.unicamp.br/~oliva Universidade Estadual de Campinas, SP, Brasil