Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2004-02-29 10:30:22

"John Maddock" <john_at_[hidden]> writes:

>> The error is on the line marked ***here***. What I'm guessing is that
>> Borland defines an overload of std::max for intrinsic types, or just
>> unsigned long, which does not return a reference, but I'm just guessing
>> here. Can anybody who has access to this toolset confirm? And how can
>> I test a fix?
> Yes, Borland's headers define:
> inline unsigned long min (unsigned long __a, unsigned long __b)
> {
> return min<unsigned long> (__a, __b);
> }
> inline unsigned long max (unsigned long __a, unsigned long __b)
> {
> return max<unsigned long> (__a, __b);
> }
> I'm not sure what the best fix is here,

You can detect at compile-time whether a call will yield an lvalue by
checking to see whether the restult can bind to a T& argument, where
T is a template parameter. See boost/iterator/is_lvalue_iterator.hpp.

Dave Abrahams
Boost Consulting

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at