Boost logo

Boost :

Subject: Re: [boost] ATTENTION: Library requirements..
From: Soul Studios (matt_at_[hidden])
Date: 2016-01-09 17:01:07

I would also like to see guidelines for the use of small custom macros
in boost libraries.

I don't mean the use of already-defined compiler-feature macros like
BOOST_NOEXCEPT etc, I mean defining small macros for the sole purposes
of a single library.

I have a number of situations in a prospective library where small macro
#defines (#undef'ing at the end of the header) which change their
definition based on the availability of specific compiler features
(allocator traits, for example), are the most elegant solution- for
various reasons but largely because the alternatives are either a lot of
"#ifdef COMPILER_FEATURE"-type code replication,
or single-line template-based inline functions which will
(a) slow compilation time,
(b) not be correctly optimised or inlined by most microsoft compilers, and
(c) make for ugly code (subjective, but there it is).

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 so can they be included-

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