From: Jean-Louis Leroy (jl_at_[hidden])
Date: 2025-05-04 09:15:14


> 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.