Boost logo

Boost :

From: Torsten Maehne (Torsten.Maehne_at_[hidden])
Date: 2008-05-29 13:04:09


Hello Steven,

thank you for your fast feedback and suggestions. I agreed to Matthias
to work out a more elaborated example and test suite. I'll add further
specializations as needed, if the tests expose missing once. I'll take
your hints (for units::unit) into account.

Steven Watanabe wrote:
>> - Is there a way to work around boost::lambda:bind's limitation
>> concerning the binding of overloaded functions? The required
>> static_cast to the function pointer (referring, e.g., a function
>> from boost/units/cmath.hpp) is tedious.
>>
>
> The problem is avoided by creating a function object. (untested)
>
> struct sin_t {
> template<class Args>
> struct sig {
> typedef typename boost::tuples::element<0>::type arg1_type;
> BOOST_TYPEOF_NESTED_TYPEDEF(nested, (sin(make<arg1_type>())));
> typedef typename nested::type type;
> };
> template<class T>
> ... operator()(const T& arg) { return(sin(arg)); }
> };

Thank you for the proposed solution for the bind problem, I'll give it a
try as soon as possible.

I'll keep you updated on the results.

Best regards,

Torsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk