Boost logo

Boost :

From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2021-03-03 09:43:21


On Tue, Mar 2, 2021 at 10:48 PM Peter Dimov via Boost <boost_at_[hidden]>
wrote:

> Maximilian Riemensberger wrote:
>
> > 2) Overloaded functions are not supported. Again, what are the reasons
> for
> > this limitation? Is it fundamentally impossible?
>
> The problem is basically that &X::f doesn't work when f is overloaded.
> There
> are probably ways around that, such as f.ex. using something like
>
> (int (X::*)(float) const, f)
>
> in place of just `f` (ugh), but I haven't yet settled on a solution I'd be
> comfortable with.
>
> (Actually I know what solution I'd be comfortable with - adding
> __describe_members to clang, gcc and msvc - but that's a difficult
> endeavor.)
>

By coincidence I was reading Folly's Poly [1] yesterday,
where Eric uses folly::sig to support overloading. Not sure it's relevant
though :)

Which brings up the question of support in Describe of non-member functions,
also mentioned on that page. Can they be incorporated into the described
members?
Just curious.

On another topic, could you have an example using std::variant?
If a described struct contains a variant which is a mix of other described
structs
and std:: values (string, vector, optional, etc...), how one does go about
dispatching to a
custom serialization method? And if that variant is not of the std::
variety, but in fact a
discriminated boost::any wrapper, as generated by Avro's C++ code
generator, how does
one hook into Describe's machinery? Or is it the other way around, and
Describe just
hands over that weird value, and it's the code it calls that's supposed to
be aware of it?
(the latter means it's the N operations that must be aware of it, instead
of the 1 Describe/Description)

Yet on something else, Boost.PFR seems to give an operator== for one's
structs out of the box.
That's a binary operation, while most of your examples are unary, no? How
would "generated" op== work
in Boost.Describe? Assuming the described structs don't have themselves an
op==, and one
would want to generate those op== using their "descriptions"?

Thanks, --DD

[1] https://github.com/facebook/folly/blob/master/folly/docs/Poly.md


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