On Sat, 15 Mar 2003 13:15:59 -0600, "David B. Held"
<[EMAIL PROTECTED]> wrote:

>"Daniel Frey" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>> [...]
>> The compiler has no idea how to deduce U as - depending on
>> U - param_type could change.
>> [...]
>
>Oh, yes, I see.  I guess call_traits is only useful when T is a
>class template parameter.  A bit unfortunate, isn't it?  I mean, it
>isn't very useful for function forwarding then, is it?

I don't know if it's useful or not but it's certainly usable. The fact
that deduction fails in your case doesn't mean it fails always; and
for named templates there's still the possibility to explicit specify
template arguments. In your case, you could do:


class foo
{
public:
    template <typename U>
    foo(typename boost::call_traits<U>::param_type v, U*)
    { }

};

int main()
{
    X x;
    foo f(x, (X*)0 );
    ...
}


It's a hack, of course, but you can always see "(X*)0" as a
syntactical alternative to "<X>" :-)


Genny.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to