Skip to content

[super! 6/6] Remove substitution_dispatch - #84

Open
mingxwa wants to merge 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/super-stage6
Open

[super! 6/6] Remove substitution_dispatch#84
mingxwa wants to merge 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/super-stage6

Conversation

@mingxwa

@mingxwa mingxwa commented Sep 11, 2026

Copy link
Copy Markdown
Member

Changes

  • Removed substitution_dispatch and its specification. A proxy of a facade built with add_facade<F> already converts to proxy<F> by carrying the metadata over directly, so a convention and an indirect call doing the same no longer earn their place.
  • Removed the substitution conventions the builder generated, the transformations observer_facade and weak_facade applied to them, and the erased_context specialization that [super! 3/6] Invoke through an erased context instead of the proxy type #68 added for substitution.
  • Redirected add_facade_with_substitution to add_facade, so existing code keeps compiling.
  • Allowed as_view and as_weak to convert a proxy<F> to a proxy_view or weak_proxy of a super of F, replacing what the removed transformations provided. The accessor names the super when the super declares the skill itself, so the metadata answers without a second conversion. Its qualifiers and target facade are deduced from the convention's own overload type, so it cannot drift from view_conversion_overload or weak_conversion_overload.

Compatibility

  • Code that names substitution_dispatch no longer compiles. A facade that declared a substitution convention to proxy<F> should add F through add_facade<F> instead, which makes proxy<F> reachable by conversion.
  • The convention_types of a facade built with add_facade_with_substitution, and of observer_facade and weak_facade, no longer contain substitution conventions. Code that inspects convention_types directly observes this. Code that uses the resulting proxy does not.

A facade added by add_facade is a super of the built facade, and a proxy
of the built facade converts to a proxy of the super by carrying the
metadata over directly. substitution_dispatch did the same by way of a
convention and an indirect call, so it no longer earns its place.

Remove the class, the conventions the builder produced for it, and the
transformations observer_facade and weak_facade applied to it.
basic_facade_builder::add_facade_with_substitution is kept and redirects
to add_facade, so existing code keeps compiling.

Converting to a view or weak proxy of a super replaces what the removed
transformations provided. The accessors of the view and weak conversion
dispatches gain a conversion function template over the target facade,
constrained on the target being reachable from the target of the own
facade, which holds for exactly the supers. The invoked overload names
the own facade, unless the super declares the skill itself, in which
case it names the super and the metadata answers without a second
conversion. Both yield the same pointer.

The overload qualifiers and the target facade transform are deduced from
the convention's own overload type, so the accessor cannot drift from
view_conversion_overload or weak_conversion_overload.
@mingxwa
mingxwa changed the base branch from main to feature/v5 September 11, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant