Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2005-10-10 14:13:05


Daniel James wrote:

> I guess there is a problem with something like:
>
> a.hpp:
>
> #define BOOST_HASH_NO_EXTENSIONS
> #include <functional>
> // ....
>
> b.hpp:
>
> #include <functional>
> // ....
>
> a.cpp:
>
> #include "a.hpp"
> #include "b.hpp"
>
> But this would really be against the intent of the macro - which is to
> check that your code is not inadvertantly making use of the extensions.
> I will suggest in the documentation that the macro is only used as a
> compiler switch, and never in headers.

What if some other Boost lib makes use of the extensions internally, so
that the user shouldn't have to care? Should Boost libs avoid the
extension so that they still work if the user defines the macro?

> Or, I could just have two classes boost::hash & boost::tr1::hash (or
> whatever). All of the implementation will still be in hash_value etc. so
> there wouldn't be any code bloat. The macro would only affect
> boost::tr1::hash, which would still include the extensions by default.
> But that seems overly complicated.

Boost libs could use the extensions under this scheme.

jon


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