Boost logo

Boost :

Subject: Re: [boost] [metal] Feature Complete - Request for Feedback
From: Klemens Morgenstern (klemens.morgenstern_at_[hidden])
Date: 2017-02-21 14:45:23

Am 21.02.2017 um 14:11 schrieb Bruno Dutra via Boost:
>> Personally, I found it better from both performance and code sanity sides
> to extract types from mpl::vector to variadic sequence via partial template
> specialization (with mpl::vectorN<Ts...> using boost PP) and then pass
> variadic type sequence to whatever TMP library I'm using
> You should be aware that this doesn't work in general, because MPL types
> are unspecified and pattern matching them actually means relying on
> implementation details. That is specially true for mpl::vector, which
> returns a proxy type that in turn masks the contents of the original
> vector whenever
> mpl::insert or mpl::erase is used, in a way that cannot be pattern matched
> like this. There is no portable way of transferring the contents of a MPL
> sequence to a variadic type, except for using MPL's own algorithms. If you
> check out the implementation of metal::from_mpl, you'll find that it relies
> on mpl::fold to extract the contents of sequences into a metal::list.
> This is by the way another advantage of Metal, since all of its types are
> precisely defined and friendly to pattern matching.
I think that's your main selling point. Afaik Hana also relys on
concepts more than on actual types; i.e. the result types are not
completely specified. If that is the case and you provide those, you've
got the place for your library.

Another dumb idea to make your life hell: do you think you could have
some interface to hana? I.e. you get a sequence from hana and have a
`decltype(metal::from_hana(seq))` to get a defined metal type? Or you
have a `metal::to_hana` function.

Boost list run by bdawes at, gregod at, cpdaniel at, john at