|
Boost : |
From: John Maddock (John_Maddock_at_[hidden])
Date: 2000-10-28 05:37:36
Bill,
>I guess I'm now a tad confused about the utility of call_traits. I
>can see how it would help with template classes in some cases, but is
>there another way to do what was being attempted here with a template
>function?
One way is to use a thin wrapper approach:
template <class T>
void foo_imp(call_traits<T>::param_type p)
{
/*details*/
}
template <class T>
void foo(const T& p)
{
foo_imp<T>(p);
}
This does not solve all the potential problems, but it can help where
parameter p is best passed by value, note that the call to foo will get
optimised away, it's just there to perform template argument deduction.
- John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk