Boost logo

Boost :

From: Mat Marcus (mmarcus_at_[hidden])
Date: 2001-12-16 02:52:31


>----- Original Message -----
>From: "Mat Marcus" <mmarcus_at_[hidden]>
>
>> Yes. Maybe a header file with a generalized n-ary function (like
>> mpl::unaryfunction) could provide a good "broken compiler portable"
>> idiom.
>
>What do you mean? I can't parse that.
>
>Sorry,
>Dave

Fair enough. Let me elaborate. MPL provides unary_function and
binary_function, apparently for use in its original bind mechanism.
(Aside: I am not really sure why Aleksey chose those names. I might
lean towards something like EvalMF2 or lexical_closure, call, or
apply). Anyway, one (anti-) refactoring that I use to help code
compile under MSVC is to rewrite template argument dependent
expressions such as:

       T::template apply<U>::type

like so:

       mpl::unary_function<T,U>::type

Similarly:

      T::template apply<U,V>::type

becomes:

       mpl::binary_function<T,U,V>::type

I was thinking that if n-ary_function's were added (perhaps using
boost/preprocessor) to support a more general bind, then we could
borrow them for the compiler workarounds as well. Of course now
another compile-time bind mechanism is under development I'm not sure
if mpl will still require n-ary_function's.

Mat


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