Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-10-02 23:18:47

----- Original Message -----
From: "Daryle Walker" <darylew_at_[hidden]>

<snip code>

> I guess the "requires_difference_operator" is supposed to enforce the
> iterator class (T) to support operator-().


> Why is there a preprocessor
> block around it based on Borland compilers? Does Borland add something to
> make the function unnecessary, or is the construct always needed but
> Borland's stuff is too stupid to accept it? If it is the latter, maybe we
> should use a new Boost #define (in "config.hpp") instead?

Can't comment on that part; I think Mark Rodgers (?) is the appropriate
source for this info. Mark?

> Also, couldn't "requires_difference_operator" be private? We don't really
> need to call it, it's just there to force the compiler to complain of
> operator-() isn't found. Maybe it could be a private static function.

No, if it's a member function it doesn't get instantiated unless used.
Inline friend functions get instantiated even if unused (but not on MSVC or
GCC which are broken in this regard), and we're taking advantage of that.
Maybe someone knows a concept checking technique which will work here
without inducing overhead even for broken compilers?


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