![]() |
Boost : |
From: Yannick Le Goc (ylegoc_at_[hidden])
Date: 2025-05-04 20:11:34
Hi Jean-Louis,
First, thanks for all the effort you put into writing a solid library on an
experimental subject.
I have a few questions.
1. Concerning the overrider selection, when the perfect match is not found,
it is said that an arbitrary choice is made.
My tests on virtual inheritance and two dimensions dispatch showed that
this is the last defined compatible overrider that is chosen.
Do you confirm ? Or what is the algorithm ?
2. The class virtual_ptr<Class> accepts only classes that inherit Class.
Would it be possible to accept inheritance unrelated classes e.g.
std::filesystem::path and std::string ?
3. Would it be possible to get rid of the class declarations ? Indeed they
are already declared in the template parameter of the virtual_ptr<>
arguments so they could be implicitly defined here.
Yannick
On Sun, May 4, 2025 at 11:15â¯AM Jean-Louis Leroy via Boost <
boost_at_[hidden]> wrote:
> > struct dynamic_policy
> > :
> boost::openmethod::default_policy::fork<dynamic_policy>::replace<
> > boost::openmethod::policies::extern_vptr,
> > boost::openmethod::policies::vptr_vector<
> > dynamic_policy,
> > boost::openmethod::policies::indirect_vptr>> {};
> >
> > Committing this code to any project I've worked on would've left most of
> my
> > coworkers absolutely checked out.
>
> With the changes in the review branch, you can now say:
>
> struct dynamic_policy
> : boost::openmethod::default_policy::fork<dynamic_policy>::add<
> boost::openmethod::policies::indirect_vptr>> {};
>
> I am pretty sure I can make this work:
>
> struct map_policy
> : default_policy::fork<map_policy>::with<vptr_map<map_policy>> {};
>
> I.e. instead of saying `replace<Facet1, Implementation1>::replace<Facet2,
> Implementation2>` you can just say `with<Implementation1,
> Implementation2>`. If
> an implementation of the same facet exists in the policy, it will be
> replaced
> with the new one, otherwise the implementation will be added. Not in the
> review
> branch yet.
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk