[super! 6/6] Remove substitution_dispatch - #84
Open
mingxwa wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
substitution_dispatchand its specification. Aproxyof a facade built withadd_facade<F>already converts toproxy<F>by carrying the metadata over directly, so a convention and an indirect call doing the same no longer earn their place.observer_facadeandweak_facadeapplied to them, and theerased_contextspecialization that [super! 3/6] Invoke through an erased context instead of the proxy type #68 added for substitution.add_facade_with_substitutiontoadd_facade, so existing code keeps compiling.as_viewandas_weakto convert aproxy<F>to aproxy_vieworweak_proxyof a super ofF, 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 fromview_conversion_overloadorweak_conversion_overload.Compatibility
substitution_dispatchno longer compiles. A facade that declared a substitution convention toproxy<F>should addFthroughadd_facade<F>instead, which makesproxy<F>reachable by conversion.convention_typesof a facade built withadd_facade_with_substitution, and ofobserver_facadeandweak_facade, no longer contain substitution conventions. Code that inspectsconvention_typesdirectly observes this. Code that uses the resultingproxydoes not.