Simplify proxy_invoke
and proxy_reflect
#226
Merged
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.
Motivation
In the current design,
proxy_invoke()
and the accessor of a convention type (specificallydetails::conv_impl
) take the convention type as their template parameter. Similarly,proxy_reflect()
and the accessor of a reflection type (specifically details::refl_impl`) also take the reflection type as their template parameter. The abuse of convention types and reflection types on these definitions makes their semantics more complex than necessary. Simplifying their definitions makes it easier to reason the code.For example, for the following facade definition:
Before this change,
proxy_indirect_accessor<MyFacade>
inherits the following two types:After this change, the two types become:
Although this change has no runtime side effects, it can potentially improve compilation speed especially when a convention type has multiple overloads.
Changes
proxy_invoke
. The first template parameter (convention typeC
) was replaced by a boolean flag (equivalent to priorC::is_direct
) and a dispatch type (equivalent to priortypename C::dispatch_type
).proxy_reflect
. The first template parameter (reflection typeR
) was replaced by a boolean flag (equivalent to priorR::is_direct
) and a reflector type (equivalent to priortypename R::reflector_type
).concept facade<F>
to detect correctness of each reflection type defined intypename F::reflection_types
. Also fixed the corresponding test case inproxy_traits_tests.cpp
.ProAccessible
requirements.