Boost logo

Boost :

Subject: Re: [boost] [review][mp11] Formal review of Mp11
From: Bruno Dutra (brunocodutra_at_[hidden])
Date: 2017-07-18 10:28:37


On Tue, Jul 18, 2017 at 9:58 AM, Joaquin M López Muñoz via Boost <
boost_at_[hidden]> wrote:

> El 17/07/2017 a las 23:03, Peter Dimov via Boost escribió:
>
>> Joaquin M López Muñoz wrote:
>>
>>> Something more generic can be provided
>>>
>>> [...]
>>>
>>> template<typename MplSequence>
>>> using mp_mpl_sequence=typename mp_mpl_sequence_impl<MplSequen
>>> ce>::type;
>>>
>>
>> How about we provide it in MPL instead?
>>
>> namespace mpl {
>>
>> template<class Seq, template<class...> class L = std::tuple> using
>> to_tuple = /*as above*/
>>
>> }
>>
>> to_tuple subject to bikeshedding (to_variadic? as_variadic_sequence?).
>
>
Personally I think this doesn't belong to MPL.

Actually I suggest providing a slightly more general utility that not
only converts MPL Sequences, but Metafunction Classes as well and also in a
recursive fashion, that is, Sequences of Sequences would be converted to
variadic Lists of variadic Lists for example.

Metal used to provide such a utility up until recently, when I decided to
remove it, but maybe it can still serve as a source of inspiration [1].
Some usage examples are available as well [2].

[1]:
https://github.com/brunocodutra/metal/blob/85d6d32f6e58e648c4573189f8bf2d7633604f27/include/metal/external/mpl.hpp
[2]:
https://github.com/brunocodutra/metal/blob/85d6d32f6e58e648c4573189f8bf2d7633604f27/example/src/mpl.cpp#L10

Bruno


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