Boost logo

Boost :

Subject: Re: [boost] Seeking endorsement for the reflection library (PFR)
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2017-11-10 08:10:23


9 нояб. 2017 г. 21:34 пользователь "Peter Dimov via Boost" <
boost_at_[hidden]> написал:

Antony Polukhin wrote:

> > You got me wondering here. Is it not possible to pass an array of size_t
> > to the size_t* parameter, instead of a single size_t, and then encode >
> the layout of X1 in it?
>
> Yes, that is what the flat reflection does. But during this operation the
> X1 type flattens/decays to the the basic types. You can not get X1 from a
> record of {int, int}.
>

Ah right. You can only get an anonymous tuple_like<int, int> type, not X1.
But isn't this still better than flattening? You could print it as { { 1, 2
}, { 3, 4} }, instead of { 1, 2, 3, 4 }.

That's one of the options. Some time ago I thought that is it less usefull
than returning flattened type. Nowadays there's a precise reflection that
does a lot of things much better, so I see no big need in improving flat
reflection.


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