Boost logo

Boost :

From: John Maddock (john_maddock_at_[hidden])
Date: 2002-12-01 06:55:09


I'm wondering if it's possible to get Lambda working with Borland's
compiler? There are a couple of issues that are easy to fix, but then
things get tricky:

1) Integral constant expressions need fully qualified names:

RCS file: /cvsroot/boost/boost/boost/lambda/detail/lambda_traits.hpp,v
retrieving revision 1.3
diff -r1.3 lambda_traits.hpp
92c92
< boost::is_function<plainT>::value,

---
>     ::boost::is_function<plainT>::value,
260c260
<       typename detail::IF<boost::is_function<T>::value, T&, const T>::RET
---
>       typename detail::IF< ::boost::is_function<T>::value, T&, const
T>::RET
2) locally declared names can't be used in integral constant expressions (a
variation of (1)):
RCS file: /cvsroot/boost/boost/boost/lambda/detail/lambda_traits.hpp,v
retrieving revision 1.3
diff -r1.3 lambda_traits.hpp
502,503c502,509
<
<   typedef
---
> #ifdef __BORLANDC__
>   typedef
>     action<
>       ::boost::tuples::length<args_t>::value,
>       function_action< ::boost::tuples::length<args_t>::value>
>     > action_type;
> #else
>   typedef
505c511
<       nof_elems,
---
>       nof_elems,
507a514
> #endif
3) Partial specialisation doesn't work in all cases, in particular Borland
can't cope with:
cv-qualified types:
template <class Func> struct function_adaptor<const Func>; // error
function types:
template <class Result>
struct function_adaptor<Result (void)> {
member function pointers:
template <class Object, class Result>
struct function_adaptor<Result (Object::*)()> {
However it can cope with specialisations on function pointers, and member
pointers:
template <class Result>
struct function_adaptor<Result (*)(void)> {...};
template <class Object, class T>
struct function_adaptor<T Object::*> {...};
Likewise is_function and is_member_function_pointer do work with Borland so
my guess is that a workaround is possible, but I don't know what :-(
John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm

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