|
Boost Users : |
Subject: [Boost-users] [review][mp11] Review report
From: Bjorn Reese (breese_at_[hidden])
Date: 2017-08-02 11:22:42
I. VERDICT
Mp11 is accepted unconditionally into Boost.
There were 14 accept votes and 1 conditional accept vote. See list at
end of this report.
II. DESIGN
Reviewers evaluated the design as very good.
Many agreed with the design principle of using template aliases on type
lists, which means that Mp11 can be used on std, boost, and custom type
lists.
Integration with MPL was discussed. This resulted in a new header file
<boost/mp11/mpl.hpp> that enables the conversion between mp_list (and
std::tuple) and MPL sequences.
A version of mp_eval_if that can apply a metafunction to type lists in
both the true and false branch was requested. This is not possible due
to C++ limitations (template parameter pack must be at the end.) Instead
two alternatives were suggested: (1) use a nested mp_eval_if in the true
branch, or (2) use mp_if<>::type with mp_defer in both branches.
Extra metafunctions were added for working with map and sets: mp_is_set,
mp_is_map, and mp_map_keys which returns a list of all keys.
No review without a discussion about names. The mp_ prefix received most
comments. The prefix is used to avoid collision between mp11 names and
C++ keywords. The argument against the mp_ prefix was that MPL and other
Boost libraries already have established trailing underscore as the
naming convention. The argument in favor is that the mp_ prefix is
better suited for later C++ standardization. Other names that deviate
from MPL, such as apply versus fn, were also pointed out, and the names
of tuple operations were also discussed.
III. IMPLEMENTATION
The reviewers who looked at the implementation were generally pleased
with its quality and simplicity.
A faster version of mp_find was proposed during review.
On reviewer pointed out that const lists causes obscure compilation
errors.
IV. DOCUMENTATION
The evaluation of the documentation was more mixed. Some found it good,
while others found it too terse.
A recurring comment was that the documentation is missing beginner-level
explanations and examples. For instance, the tuple_cat example was
mentioned as being too advanced for an introduction.
More examples with higher-order metafunctions (e.g. mp_bind) was
requested.
The reference documentation does not state the pre-conditions of the
metafunctions. For example, what happens when indices are out of bounds?
The description of map (list of lists) lead to confusion. Mp11 map
entries have one unique key-type, and zero or more value-types. The
ability to have multiple value-types per key-type makes it possible to
emulate multi-maps.
Some where unsure whether C++11 or C++14 was required for the library.
There were plenty of other useful comments that I will omit from the
review report for the sake of brevity.
V. USEFULNESS
The library was generally deemed useful.
It was discussed if C++11 (and later) makes it too easy to write our
own metaprogramming utilities, and thus not needing a metaprogramming
library. This was not directed at Mp11 in particular. Some of the
arguments in favor of a metaprogramming library were better performance
and portability.
I would like to add another advantage of a metaprogramming library,
namely that it gives us a common vocabulary.
VI. CONCLUSION
The library fulfills the quality and usefulness criteria without major
outstanding issues. The library is therefore cleared to be included into
Boost.
My main recommendation as review manager is to make the documentation
more beginner-friendly before the library is added to Boost. This is a
recommendation, not a requirement.
VII. PARTICIPANTS
The following formal reviews were posted:
* Barrett Adair : Accept
* Brook Milligan : Accept
* Edward Diener : Accept
* Glen Fernandes : Accept
* Jason Rice : Accept
* Joaquin M López Muñoz : Conditional accept
* John P Fletcher : Accept
* Lee Clagett : Accept
* Paul Fultz : Accept
* Peter Koch Larsen : Accept
* Robert Ramey : Accept
* Roberto Hinz : Accept
* Vijayan : Accept
* Vinnie Falco : Accept
* Zach Laine : Accept
I would like to thank all participants for their efforts.
I would also like to thank Peter Dimov for bringing such a high-quality
library to Boost.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net