Boost logo

Boost :

Subject: Re: [boost] [system] error_code.hpp - questionable includes
From: Christian Holmquist (c.holmquist_at_[hidden])
Date: 2010-06-04 13:02:00


boost/noncopyable.hpp is only 37 lines

> of code and has no dependencies. I highly
> doubt that removing it will have any effect
> on compile times.
>
>
Sure. This can be said about of lot of files, especially in Boost with such
a high granularity.
With my battling-compilation-time-hat on (which is unfortunately always on
nowadays) I choose to remove #includes if at all possible,
even when the gain is presumably small.

>
>
> 2)
>> inclusion of <functional> seems only needed to have the following:
>> bool operator<( const error_category & rhs ) const
>> {
>> return std::less<const error_category*>()( this, &rhs );
>> }
>> I can't guess the reason for using std::less instead of simply writing
>> '<',
>> but surely it can be expressed without std::less, no?
>>
>>
>
> No it can't. operator< is not guaranteed to behave sanely
> for arbitrary pointers. std::less defines a total ordering for
> pointers.
>
>
Boost should of course aim for correctness so I stand corrected, but is this
a theoretical problem or a real one?
Are there platforms where:
this < &rhs
will be wrong in this case?

In Christ,
> Steven Watanabe
>
>
Thanks,
Christian


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