Boost logo

Boost :

Subject: Re: [boost] Formal Review Request: mp11
From: Bjorn Reese (breese_at_[hidden])
Date: 2017-03-18 13:41:35


On 03/17/2017 03:06 PM, Peter Dimov via Boost wrote:

> https://github.com/pdimov/mp11/

A few comments...

Most algorithms take the typelist as the first argument, but others
do not, e.g. mp_transform<F, L...>. If possible, I would like to see
all algorithms take typelist as the first argument. It looks like the
current order is dictated by the requirements of mp_tranform_impl.
Would it be possible to swap the types where the algorithm is
declared? For example:

   template<class L, template<class...> class F> using mp_transform =
typename detail::mp_transform_impl<F, L>::type;

Apropos mp_transform, would it be possible to extend it such that we
can pass a type-trait directly to it? For example:

   using const_list = mp_transform<std::add_const, typelist>;

instead of using std::add_const_t. The reason I ask is that I have
lots of my own domain-specific type-traits that does not come with
a _t version, so this is mainly for convenience.

The reference documentation is a bit terse and obscure. For example, the
documentation for mp_find tells us in a convoluted way that it returns
the index of a type in a typelist. It could also mention that it is
the dual algorithm to mp_at, which returns a type at an index in a
typelist.


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