Boost logo

Boost :

Subject: Re: [boost] [review][mp11] Formal review of Mp11
From: Peter Dimov (lists_at_[hidden])
Date: 2017-07-17 11:05:02


> > We already have subnamespaces in std (e.g. std::chrono), so your
> > standardization plan could be realized as s/boost/std.
>
> It could if I wanted to propose std::mp::if_, but I don't. I want to
> propose std::mp_if.
>
> I know that this makes the library more difficult to use in other Boost
> libraries where there's no convenient place to put the using directive.
> :-/

To expand on this a bit:

There are, in general, two main modes of use of Mp11, serving two audiences.
One is the "easy mode", where one includes <boost/mp11.hpp>, combines that
with `using namespace boost::mp11;`, then goes ahead using mp_this and
mp_that without qualification. This serves (a) people who play with
metaprogramming in short test cases, (b) people who have a need for a
metaprogram in a .cpp file (or an internal header file not meant for public
consumption), whether library or application one.

Mode two is in use in header-only libraries. There the library author is
generally reluctant to employ the using directive, which forces the
comparatively awkward mp11::mp_this style.

I realize that my choice gives preference to case one at the expense of case
two.


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