Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/spec/ProBasicConvention.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

A type `C` meets the *ProBasicConvention* requirements if the following expressions are well-formed and have the specified semantics.

| Expressions | Semantics |
| ---------------------------- | ------------------------------------------------------------ |
| `C::is_direct` | A [core constant expression](https://en.cppreference.com/w/cpp/language/constant_expression) of type `bool`, specifying whether the convention applies to a pointer type itself (`true`), or the element type of a pointer type (`false`). |
| `typename C::dispatch_type` | A type that defines how the calls are forwarded to the concrete types. Shall be *nothrow-default-constructible* and *nothrow-destructible*. |
| `typename C::overload_types` | A [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type of one or more distinct types `Os`. Each type `O` in `Os` shall meet the [*ProOverload* requirements](ProOverload.md). |
| Expressions | Semantics |
| ------------------------------------------------ | ------------------------------------------------------------ |
| `C::is_direct` | A [core constant expression](https://en.cppreference.com/w/cpp/language/constant_expression) of type `bool`, specifying whether the convention applies to a pointer type itself (`true`), or the element type of a pointer type (`false`). |
| `typename C::dispatch_type` | A type that defines how the calls are forwarded to the concrete types. Shall be *nothrow-default-constructible* and *nothrow-destructible*. |
| `typename C::overload_type`<br />*(since 5.0.0)* | A type that meets the [*ProOverload* requirements](ProOverload.md). |

## See Also

Expand Down
2 changes: 1 addition & 1 deletion docs/spec/ProConvention.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A type `C` meets the *ProConvention* requirements of a type `P` if `C` meets the

| Expressions | Semantics |
| ---------------------------- | ------------------------------------------------------------ |
| `typename C::overload_types` | A [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type that contains one or more distinct types `Os`. Each type `O` in `Os` shall meet the [*ProOverload* requirements](ProOverload.md), and<br />- when `C::is_direct` is `true`, `typename C::dispatch_type` shall meet the [*ProDispatch* requirements](ProDispatch.md) of `P` and `O`, <br />- or otherwise, when `C::is_direct` is `false`, let `QP` be a qualified reference type of `P` with the *cv ref* qualifiers defined by `O` (`QP` is an lvalue reference type if `O` does not define a *ref* qualifier), `qp` be a value of `QP`, `*std::forward<QP>(qp)` shall be well-formed, and `typename C::dispatch_type` shall meet the [*ProDispatch* requirements](ProDispatch.md) of `decltype(*std::forward<QP>(qp))` and `O`. |
| `typename C::overload_type` | A type `O` that meets the [*ProOverload* requirements](ProOverload.md), where<br />- when `C::is_direct` is `true`, `typename C::dispatch_type` shall meet the [*ProDispatch* requirements](ProDispatch.md) of `P` and `O`, <br />- or otherwise, when `C::is_direct` is `false`, let `QP` be a qualified reference type of `P` with the *cv ref* qualifiers defined by `O` (`QP` is an lvalue reference type if `O` does not define a *ref* qualifier), `qp` be a value of `QP`, `*std::forward<QP>(qp)` shall be well-formed, and `typename C::dispatch_type` shall meet the [*ProDispatch* requirements](ProDispatch.md) of `decltype(*std::forward<QP>(qp))` and `O`. |

## See Also

Expand Down
16 changes: 9 additions & 7 deletions docs/spec/basic_facade_builder/add_convention.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ using add_direct_convention = basic_facade_builder</* see below */>;
The alias templates `add_convention`, `add_indirect_convention`, and `add_direct_convention` of `basic_facade_builder<Cs, Rs, MaxSize, MaxAlign, Copyability, Relocatability, Destructibility>` add convention types to the template parameters. The expression inside `requires` is equivalent to `sizeof...(Os) > 0u` and each type in `Os` meets the [*ProOverload* requirements](../ProOverload.md). Let `F` be a facade type,

- `add_convention` is equivalent to `add_indirect_convention`.
- `add_indirect_convention` merges an implementation-defined convention type `IC` into `Cs`, where:
- `add_indirect_convention` merges an implementation-defined convention type `IC` into `Cs` for each type `O` in `Os`, where:
- `IC::is_direct` is `false`.
- `typename IC::dispatch_type` is `D`.
- `typename IC::overload_types` is a [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type of distinct types in `Os`.
- `typename IC::template accessor<F>` is `typename D::template accessor<proxy_indirect_accessor<F>, D, `[`substituted-overload<Os, F>`](../ProOverload.md)`...>` if applicable.
- `add_direct_convention` merges an implementation-defined convention type `IC` into `Cs`, where:
- `typename IC::overload_type` is `O`.
- `add_direct_convention` merges an implementation-defined convention type `IC` into `Cs` for each type `O` in `Os`, where:
- `IC::is_direct` is `true`.
- `typename IC::dispatch_type` is `D`.
- `typename IC::overload_types` is a [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type of distinct types in `Os`.
- `typename IC::template accessor<F>` is `typename D::template accessor<proxy<F>, D, `[`substituted-overload<Os, F>`](../ProOverload.md)`...>` if applicable.
- `typename IC::overload_type` is `O`.

When `Cs` already contains a convention type `IC2` where `IC2::is_direct == IC::is_direct && std::is_same_v<typename IC2::dispatch_type, typename IC::dispatch_type>` is `true`, `Os` merges with `typename IC2::overload_types` and removes duplicates, and `std::tuple_size_v<Cs>` shall not change.
When `Cs` already contains a convention type identical to `IC`, the template parameters shall not change.

Let `F` be a facade type. The accessor a convention contributes to a [`proxy`](../proxy/README.md) of `F` is formed per dispatch type rather than per convention: let `Gs` be the types in `Cs` that share `IC::is_direct` and `typename IC::dispatch_type`, and `GOs` be their `overload_type`s in order of first appearance. The accessor is `typename D::template accessor<proxy_indirect_accessor<F>, D, `[`substituted-overload<GOs, F>`](../ProOverload.md)`...>` when `IC::is_direct` is `false`, or `typename D::template accessor<proxy<F>, D, `[`substituted-overload<GOs, F>`](../ProOverload.md)`...>` when it is `true`, if applicable.

*Since 5.0.0*: each type in `Os` produces its own convention type, rather than one convention type carrying a tuple-like `overload_types`.

## Notes

Expand Down
4 changes: 3 additions & 1 deletion docs/spec/proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ Any instance of `proxy<F>` at any given point in time either *contains a value*

As per `facade<F>`, `typename F::convention_types` shall be a [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type containing any number of distinct types `Cs`, and `typename F::reflection_types` shall be a [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type containing any number of distinct types `Rs`.

- For each type `C` in `Cs`, if `C::is_direct` is `true` and `typename C::dispatch_type` meets the [*ProAccessible* requirements](../ProAccessible.md) of `proxy<F>, typename C::dispatch_type, substituted-overload-types...`, `typename C::dispatch_type::template accessor<proxy<F>, typename C::dispatch_type, substituted-overload-types...>` is inherited by `proxy<F>`. Let `Os...` be the element types of `typename C::overload_types`, `substituted-overload-types...` is [`substituted-overload<Os, F>...`](../ProOverload.md).
- For each distinct dispatch type `D` among the types `C` in `Cs` where `C::is_direct` is `true`, let `Os...` be the overload types of those conventions with duplicates removed, and `substituted-overload-types...` be [`substituted-overload<Os, F>...`](../ProOverload.md). If `D` meets the [*ProAccessible* requirements](../ProAccessible.md) of `proxy<F>, D, substituted-overload-types...`, `typename D::template accessor<proxy<F>, D, substituted-overload-types...>` is inherited by `proxy<F>`.
- For each type `R` in `Rs`, if `R::is_direct` is `true` and `typename R::reflector_type` meets the [*ProAccessible* requirements](../ProAccessible.md) of `proxy<F>, typename R::reflector_type`, `typename R::reflector_type::template accessor<proxy<F>, typename R::reflector_type` is inherited by `proxy<F>`.

*Since 5.0.0*: the accessor of a dispatch type is formed from the overload types of every convention in `Cs` sharing that dispatch type, rather than from a single convention.

## Member Types

| Name | Description |
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/proxy/friend_invoke.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ There shall be a convention type `Conv` defined in `typename F::convention_types

- `Conv::is_direct` is `true`, and
- `typename Conv::dispatch_type` is `D`, and
- there shall be an overload type `O1` defined in `typename Conv::overload_types` where [`substituted-overload`](../ProOverload.md)`<O1, F>` is `O`.
- [`substituted-overload`](../ProOverload.md)`<typename Conv::overload_type, F>` is `O`.

This function is not visible to ordinary [unqualified](https://en.cppreference.com/w/cpp/language/unqualified_lookup) or [qualified lookup](https://en.cppreference.com/w/cpp/language/qualified_lookup). It can only be found by [argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl) when `proxy<F>` is an associated class of the arguments.

Expand Down
4 changes: 3 additions & 1 deletion docs/spec/proxy_indirect_accessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ class proxy_indirect_accessor;

Class template `proxy_indirect_accessor` provides indirection accessibility for `proxy`. As per `facade<F>`, `typename F::convention_types` shall be a [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type containing any number of distinct types `Cs`, and `typename F::reflection_types` shall be a [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type containing any number of distinct types `Rs`.

- For each type `C` in `Cs`, if `C::is_direct` is `false` and `typename C::dispatch_type` meets the [*ProAccessible* requirements](../ProAccessible.md) of `proxy_indirect_accessor<F>, typename C::dispatch_type, substituted-overload-types...`, `typename C::dispatch_type::template accessor<proxy<F>, typename C::dispatch_type, substituted-overload-types...>` is inherited by `proxy_indirect_accessor<F>`. Let `Os...` be the element types of `typename C::overload_types`, `substituted-overload-types...` is [`substituted-overload<Os, F>...`](../ProOverload.md).
- For each distinct dispatch type `D` among the types `C` in `Cs` where `C::is_direct` is `false`, let `Os...` be the overload types of those conventions with duplicates removed, and `substituted-overload-types...` be [`substituted-overload<Os, F>...`](../ProOverload.md). If `D` meets the [*ProAccessible* requirements](../ProAccessible.md) of `proxy_indirect_accessor<F>, D, substituted-overload-types...`, `typename D::template accessor<proxy_indirect_accessor<F>, D, substituted-overload-types...>` is inherited by `proxy_indirect_accessor<F>`.
- For each type `R` in `Rs`, if `R::is_direct` is `false` and `typename R::reflector_type` meets the [*ProAccessible* requirements](../ProAccessible.md) of `proxy_indirect_accessor<F>, typename R::reflector_type`, `typename R::reflector_type::template accessor<proxy_indirect_accessor<F>, typename R::reflector_type` is inherited by `proxy_indirect_accessor<F>`.

*Since 5.0.0*: the accessor of a dispatch type is formed from the overload types of every convention in `Cs` sharing that dispatch type, rather than from a single convention.

## Member Functions

| Name | Description |
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/proxy_indirect_accessor/friend_invoke.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ There shall be a convention type `Conv` defined in `typename F::convention_types

- `Conv::is_direct` is `false`, and
- `typename Conv::dispatch_type` is `D`, and
- there shall be an overload type `O1` defined in `typename Conv::overload_types` where [`substituted-overload`](../ProOverload.md)`<O1, F>` is `O`.
- [`substituted-overload`](../ProOverload.md)`<typename Conv::overload_type, F>` is `O`.

This function is not visible to ordinary [unqualified](https://en.cppreference.com/w/cpp/language/unqualified_lookup) or [qualified lookup](https://en.cppreference.com/w/cpp/language/qualified_lookup). It can only be found by [argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl) when `proxy_indirect_accessor<F>` is an associated class of the arguments.

Expand Down
Loading
Loading