diff --git a/DRAFT.md b/DRAFT.md index 548efec..480e15e 100644 --- a/DRAFT.md +++ b/DRAFT.md @@ -52,6 +52,8 @@ and code injection and focuses solely on the design of the class templates This is a very early stage design which we are sharing to further discussion of design differences with a series of competing proposals for structural-subtyping. +This paper explores a different approach to proxy and relies on reflection rather than templates for a smaller API surface. + ## Motivation Using `protocol`, functions can be written with run-time polymorphism @@ -147,8 +149,8 @@ class protocol_view { ``` Code generation is currently implemented in a reference implementation with a -custom build step but would be better implemented by a compiler extension or -by using extended post-C++26 static reflection features. +custom build step but would be better implemented with generative reflection post +C++26. ### Function-like examples @@ -591,6 +593,16 @@ the allocators are not swapped. 3. _Remarks_: This function is a no-op if both arguments are valueless before the call. +#### X.Y.8 Member access [protocol.member.access] + +1. For each public non-static, non-template member function _f_ declared in _I_ with name _N_, return type _R_, parameter-type-list _P_, cv-qualifier-seq _cv_, and ref-qualifier _ref_, `protocol` shall contain a public non-virtual member function with the same name _N_, return type _R_, parameter-type-list _P_, and identical cv-qualifiers and ref-qualifiers. + +2. _Effects_: If `*this` is not valueless, calls the corresponding member function of the owned object with the provided arguments. If `*this` is valueless, the behavior is undefined. + +3. _Returns_: The value returned from the called function, if any. + +4. _Throws_: Any exception thrown by the called function. +