Boost logo

Boost :

Subject: Re: [boost] "protected" APIs
From: Alf P. Steinbach (alf.p.steinbach+usenet_at_[hidden])
Date: 2012-01-02 14:03:36


On 02.01.2012 10:25, Lorenzo Caminiti wrote:
> Hello all,
>
> Boost.Closure (formerly, Boost.Local) needs to use some macros, types,
> etc that are currently marked private in Boost.ScopeExit:
>
> BOOST_SCOPE_EXIT_AUX_TAG
> boost::scope_exit::aux::undeclared
> ...
>
> So I will move these symbols from AUX/aux to another prefix/namespace.
> How shall the new prefix/namespace be named?
>
> These symbols should not go into the public API of ScopeExit because
> they should never be used by the end user. These symbols are only
> meant to be used by other parts of Boost so they should use some sort
> of "protected" prefix/namespace. For example, I could use "detail":
> "aux" for ScopeExit private API and "detail" for ScopeExit API that
> can be used within Boost but not by general users:
>
> BOOST_SCOPE_EXIT_DETAIL_TAG
> boost::scope_exit::detail::undeclared
>
> However, other Boost components already use "detail" for their private
> API (synonymous of "aux"). So, I could use "protected" instead:
>
> BOOST_SCOPE_EXIT_PROTECTED_TAG
> boost::scope_exit::protected_::undeclared
>
> What's the best convention to follow here?

Fix the design.

If you as a Boost library developer "needs" this, then folks who /use/
Boost also need it.

Another example of that: the use of preprocessor magic in Boost
parameters lib.

Microsoft once claimed that it was their intention that people should
use undocumented stuff, then they'd document whatever became ad hoc
standard (e.g. like lopen in early Windows).

Boost should not be that kind, but alas, it already it is: I urge Boost
developers to work *hard* (which is needed) to get the thing back on the
Right Track(TM).

Cheers & hth.,

- Alf


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