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
< boost::is_function<plainT>::value,

>     ::boost::is_function<plainT>::value,
<       typename detail::IF<boost::is_function<T>::value, T&, const T>::RET
>       typename detail::IF< ::boost::is_function<T>::value, T&, const
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
<   typedef
> #ifdef __BORLANDC__
>   typedef
>     action<
>       ::boost::tuples::length<args_t>::value,
>       function_action< ::boost::tuples::length<args_t>::value>
>     > action_type;
> #else
>   typedef
<       nof_elems,
>       nof_elems,
> #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
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

Boost list run by bdawes at, gregod at, cpdaniel at, john at