Re: partial partial template specialization?
In article
<6180b69d-db7d-429b-a6b8-9bd0c3d42db9@e53g2000hsa.googlegroups.com>,
<rbinion@comcast.net> wrote:
Unfortunately I can not seem to get this approach to work. As I
indicated in my previous reply, my compiler seems to have problems
making friends. The primary template for the helper class receives
friend status, but the specialization does not ...
overload a function with a dummy arg call that function
with an appropriate dummy arg, in operator T(); such as:
template <class T,int Min=0,int Max = 0>
class Foo
{
template <class U>
struct identity{typedef U type;};
T do_conversion(identity<T>)
{ /* general conversion */}
char do_conversion(identity<char>)
{ /* special conversion */}
public:
operator T() {return do_conversion(identity<T>());}
//...
};
or use boost::enable_if/disable_if to choose function
that operator T() will call.
boost::enable_if /disable_if and is_same, are easy enough to write
if you don't want to use boost.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]