Boost logo

Boost :

Subject: Re: [boost] ATTENTION: Library requirements..
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2016-01-09 23:26:08

On Sat, Jan 9, 2016 at 5:01 PM, Soul Studios wrote:
> I would also like to see guidelines for the use of small custom macros in
> boost libraries.
> I can't find anything in your documentation, so I just thought I'd ask if
> there are any definitive guidelines around the use of small macros in boost
> libraries.

If there are macros in your public headers that are defined but
always undefined, then it won't impact users of your library.

If the macros are not undefined:
1. Make sure they are documented so that users know about them
2. Make sure the macro namess are prefixed with the library name

For example, for Boost.Something, in boost/something/file.hpp:

    // ...
    #if defined(__INTEL_COMPILER)
    // ...
    #if !defined(BOOST_NO_CXX11_ALLOCATOR)
    // ...
    // ...

Of course, include guard macros fall into the second category, but
it's fine if you do not document them. (And it wouldn't be a bad idea
for macros in the first category to also be prefixed with the library


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