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
8 changes: 5 additions & 3 deletions docs/spec/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ nav:
- Classes:
- bad_proxy_cast: bad_proxy_cast.md
- basic_facade_builder<br />facade_builder: basic_facade_builder
- compact_metadata<br />inline_metadata: compact_metadata.md
- constraint_level: constraint_level.md
- explicit_conversion_dispatch<br />conversion_dispatch: explicit_conversion_dispatch
- facade_aware_overload_t: facade_aware_overload_t.md
- implicit_conversion_dispatch: implicit_conversion_dispatch
- is_bitwise_trivially_relocatable: is_bitwise_trivially_relocatable.md
- not_implemented: not_implemented.md
- operator_dispatch: operator_dispatch
- proxy_dependent_signature: proxy_dependent_signature.md
- proxy_indirect_accessor: proxy_indirect_accessor
- proxy_view<br />observer_facade: proxy_view.md
- proxy: proxy
Expand Down Expand Up @@ -45,11 +46,12 @@ nav:
- ProAccessible: ProAccessible.md
- ProBasicConvention: ProBasicConvention.md
- ProBasicFacade: ProBasicFacade.md
- ProBasicMeta: ProBasicMeta.md
- ProBasicMetadata: ProBasicMetadata.md
- ProBasicReflection: ProBasicReflection.md
- ProConvention: ProConvention.md
- ProDispatch: ProDispatch.md
- ProFacade: ProFacade.md
- ProMeta: ProMeta.md
- ProMetadata: ProMetadata.md
- ProMetadataPolicy: ProMetadataPolicy.md
- ProOverload: ProOverload.md
- ProReflection: ProReflection.md
21 changes: 0 additions & 21 deletions docs/spec/ProBasicMeta.md

This file was deleted.

22 changes: 22 additions & 0 deletions docs/spec/ProBasicMetadata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Named requirements: *ProBasicMetadata*

> Since: 5.0.0

A type `M` meets the *ProBasicMetadata* requirements if `M` is a class type, and the following expressions are well-formed and have the specified semantics (let `m` be a value of type `M`, `cm` be a value of type `const M`).

| Expressions | Semantics |
| ----------- | ------------------------------------------------------------ |
| `M()` | Creates an object of type `M` holding unspecified metadata, shall not throw. |
| `M(cm)` | Creates an object of type `M` holding the metadata of `cm`, shall not throw. |
| `m = cm` | Replaces the metadata of `m` with the metadata of `cm`, shall not throw. |
| `m.~M()` | Destroys the object `m`, shall not throw. |

## Notes

"Metadata" is an object holding information deduced from a type at compile time, stored in or referenced by a [`proxy`](proxy/README.md). Because `proxy` creates, copies, assigns, and destroys metadata in contexts specified not to throw, none of these operations may throw.

## See Also

- [*ProBasicReflection* requirements](ProBasicReflection.md)
- [*ProMetadata* requirements](ProMetadata.md)
- [*ProMetadataPolicy* requirements](ProMetadataPolicy.md)
4 changes: 2 additions & 2 deletions docs/spec/ProBasicReflection.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ A type `R` meets the *ProBasicReflection* requirements if the following expressi
| Expressions | Semantics |
| ---------------------------- | ------------------------------------------------------------ |
| `R::is_direct` | A [core constant expression](https://en.cppreference.com/w/cpp/language/constant_expression) of type `bool`, specifying whether the reflection applies to a pointer type itself (`true`), or the element type of a pointer type (`false`). |
| `typename R::reflector_type` | A type that defines the data structure reflected from the type. Shall meet the [*ProBasicMeta* requirements](ProBasicMeta.md) *(since 5.0.0)*. |
| `typename R::reflector_type` | A type that defines the data structure reflected from the type. Shall meet the [*ProBasicMetadata* requirements](ProBasicMetadata.md) *(since 5.0.0)*. |

## See Also

- [*ProBasicFacade* requirements](ProBasicFacade.md)
- [*ProBasicMeta* requirements](ProBasicMeta.md)
- [*ProBasicMetadata* requirements](ProBasicMetadata.md)
- [*ProReflection* requirements](ProReflection.md)
4 changes: 2 additions & 2 deletions docs/spec/ProConvention.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Named requirements: *ProConvention*

A type `C` meets the *ProConvention* requirements of a type `P` if `C` meets the [*ProBasicConvention* requirements](ProBasicConvention.md), and the following expressions are well-formed and have the specified semantics.
A type `C` meets the *ProConvention* requirements of a type `P` and a type `MP`, where `MP` meets the [*ProMetadataPolicy* requirements](ProMetadataPolicy.md), if `C` meets the [*ProBasicConvention* requirements](ProBasicConvention.md), and the following expressions are well-formed and have the specified semantics.

| Expressions | Semantics |
| ---------------------------- | ------------------------------------------------------------ |
| `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`. |
| `typename C::overload_type` | A type `O` such that [`substituted-overload`](ProOverload.md)`<O, F, MP>` meets the [*ProOverload* requirements](ProOverload.md) for the facade type `F` that declares `C`, 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
8 changes: 4 additions & 4 deletions docs/spec/ProFacade.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Named requirements: *ProFacade*

A type `F` meets the *ProFacade* requirements of a type `P` if `F` meets the [*ProBasicFacade* requirements](ProBasicFacade.md), and the following expressions are well-formed and have the specified semantics.
A type `F` meets the *ProFacade* requirements of a type `P` and a type `MP`, where `MP` meets the [*ProMetadataPolicy* requirements](ProMetadataPolicy.md), if `F` meets the [*ProBasicFacade* requirements](ProBasicFacade.md), and the following expressions are well-formed and have the specified semantics.

| Expressions | Semantics |
| ---------------------------------------------- | ------------------------------------------------------------ |
| `typename F::super_types`<br />*(since 5.0.0)* | A [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type that contains any number of types `Ss`. Each type `S` in `Ss` shall meet the *ProFacade* requirements of `P`. |
| `typename F::convention_types` | A [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type that contains any number of types `Cs`. Each type `C` in `Cs` shall meet the [*ProConvention* requirements](ProConvention.md) of `P`. |
| `typename F::super_types`<br />*(since 5.0.0)* | A [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type that contains any number of types `Ss`. Each type `S` in `Ss` shall meet the *ProFacade* requirements of `P` and `MP`. |
| `typename F::convention_types` | A [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type that contains any number of types `Cs`. Each type `C` in `Cs` shall meet the [*ProConvention* requirements](ProConvention.md) of `P` and `MP`. |
| `typename F::reflection_types` | A [tuple-like](https://en.cppreference.com/w/cpp/utility/tuple/tuple-like) type that contains any number of types `Rs`. Each type `R` in `Rs` shall meet the [*ProReflection* requirements](ProReflection.md) of `P`. |
| `F::max_size` | A [core constant expression](https://en.cppreference.com/w/cpp/language/constant_expression) of type `std::size_t` that shall be greater than or equal to `sizeof(P)`. |
| `F::max_align` | A [core constant expression](https://en.cppreference.com/w/cpp/language/constant_expression) of type `std::size_t` that shall be greater than or equal to `alignof(P)`. |
| `F::copyability` | A [core constant expression](https://en.cppreference.com/w/cpp/language/constant_expression) of type [`constraint_level`](constraint_level.md) that defines the required copyability of `P`. |
| `F::relocatability` | A [core constant expression](https://en.cppreference.com/w/cpp/language/constant_expression) of type [`constraint_level`](constraint_level.md) that defines the required relocatability of `P`. |
| `F::destructibility` | A [core constant expression](https://en.cppreference.com/w/cpp/language/constant_expression) of type [`constraint_level`](constraint_level.md) that defines the required destructibility of `P`. |

*Since 5.0.0*: let `Cs` be the conventions of `F` and of every super of `F`, reachable via `typename F::super_types` transitively. Each type `C` in `Cs` whose `typename C::overload_type` is a specialization of [`facade_aware_overload_t`](facade_aware_overload_t.md) shall also meet the [*ProConvention* requirements](ProConvention.md) of `P` with [`substituted-overload`](ProOverload.md)`<typename C::overload_type, F>` in place of `typename C::overload_type`. Among the types in `Cs` sharing `is_direct` and `dispatch_type`, distinct `overload_type`s shall substitute to distinct overloads.
*Since 5.0.0*: let `Cs` be the conventions of `F` and of every super of `F`, reachable via `typename F::super_types` transitively. Each type `C` in `Cs` whose `typename C::overload_type` is a specialization of [`proxy_dependent_signature`](proxy_dependent_signature.md) shall also meet the [*ProConvention* requirements](ProConvention.md) of `P` with [`substituted-overload`](ProOverload.md)`<typename C::overload_type, F, MP>` in place of `typename C::overload_type`. Among the types in `Cs` sharing `is_direct` and `dispatch_type`, distinct `overload_type`s shall substitute to distinct overloads.

*Since 4.0.2*: `P` shall be a pointer-like type eligible for `proxy`. A type `P` is eligible if the following condition is satisfied:

Expand Down
7 changes: 4 additions & 3 deletions docs/spec/ProMeta.md → docs/spec/ProMetadata.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Named requirements: *ProMeta*
# Named requirements: *ProMetadata*

> Since: 5.0.0

A type `M` meets the *ProMeta* requirements of a type `T` if `M` meets the [*ProBasicMeta* requirements](ProBasicMeta.md), and the following expressions are well-formed and have the specified semantics.
A type `M` meets the *ProMetadata* requirements of a type `T` if `M` meets the [*ProBasicMetadata* requirements](ProBasicMetadata.md), and the following expressions are well-formed and have the specified semantics.

| Expressions | Semantics |
| -------------------------- | ------------------------------------------------------------ |
| `M(std::in_place_type<T>)` | Creates an object of type `M` holding implementation-defined metadata of type `T`, shall not throw. |

## See Also

- [*ProBasicMeta* requirements](ProBasicMeta.md)
- [*ProBasicMetadata* requirements](ProBasicMetadata.md)
- [*ProMetadataPolicy* requirements](ProMetadataPolicy.md)
- [*ProReflection* requirements](ProReflection.md)
43 changes: 43 additions & 0 deletions docs/spec/ProMetadataPolicy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Named requirements: *ProMetadataPolicy*

> Since: 5.0.0

A metadata policy determines how a [`proxy`](proxy/README.md) erases an invocation and how it keeps the metadata deduced from the contained type.

A nullable type is a type meeting the [*ProBasicMetadata* requirements](ProBasicMetadata.md) whose default-constructed value holds nothing, and for which `static_cast<bool>(v)` is a non-throwing expression that yields `false` if and only if `v` holds nothing.

A type `MP` meets the *ProMetadataPolicy* requirements if the following expressions are well-formed and have the specified semantics, where

- `Ctx` is an implementation-defined *erased context* type that identifies the contained value of a `proxy`, and for which an implementation-defined function template `invoke` is found by [argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl),
- `O` is a type meeting the [*ProOverload* requirements](ProOverload.md), `R` is the return type of `O` and `Args...` are the argument types of `O`,
- `P` is a pointer type eligible for `proxy` (see [*ProFacade* requirements](ProFacade.md)),
- `M` is a nullable type meeting the [*ProBasicMetadata* requirements](ProBasicMetadata.md) and the [*ProMetadata* requirements](ProMetadata.md) of `P`.

| Expressions | Semantics |
| --------------------------------------- | ------------------------------------------------------------ |
| `typename MP::template invoker<Ctx, O>` | A nullable type `I` meeting the [*ProBasicMetadata* requirements](ProBasicMetadata.md). `I` shall not be [final](https://en.cppreference.com/w/cpp/language/final). |
| `typename MP::template storage<M>` | A nullable type `S` meeting the [*ProBasicMetadata* requirements](ProBasicMetadata.md). |

Let `ci` be a value of type `const I`, `ctx` be a value of type `Ctx`, `args...` be values of type `Args...`, `s` be a value of type `S`, and `cs` be a value of type `const S`. The following expressions shall be well-formed and have the specified semantics.

| Expressions | Semantics |
| -------------------------------------- | ------------------------------------------------------------ |
| `I(std::in_place_type<P>)` | Creates an object of type `I` that holds an invoker of `P`, shall not throw. |
| `ci(ctx, std::forward<Args>(args)...)` | Has the same effect as `invoke<P>(ctx, std::forward<Args>(args)...)`, where `P` is the type `ci` was created with, and the return type is `R`. Shall not throw when `O` is a `noexcept` overload. The behavior is undefined when `ci` holds no invoker. |
| `S(std::in_place_type<P>)` | Creates an object of type `S` that holds the metadata `M(std::in_place_type<P>)`, shall not throw. |
| `*cs` | A `const M&` referring to the metadata held by `cs`. The behavior is undefined when `cs` holds no metadata. |
| `s = cs2` | Where `cs2` is a value of type `const MP::template storage<M2>`, for some type `M2` whose `const M2&` is [nothrow-convertible](https://en.cppreference.com/w/cpp/types/is_convertible) to `const M&`. Replaces the metadata of `s` with the metadata of `cs2` converted to `M`, shall not throw. The behavior is undefined when `cs2` holds no metadata. |

## Notes

`I` is required not to be final because `proxy` composes the invokers of all the conventions of a facade into a single metadata object by inheritance.

The last expression is what makes a conversion to a super well-formed. The metadata of a super is reachable from the metadata of the deriving facade, so assigning the latter to the former transfers the invokers the super needs.

The metadata type of a [`proxy`](proxy/README.md)`<F, MP>` depends on both `F` and `MP`, so a `proxy` converts only to a `proxy` with the same metadata policy. The metadata policy is therefore chosen once, where the `proxy` type is named, and every conversion from that point on stays within it.

## See Also

- [class `compact_metadata`<br />class `inline_metadata`](compact_metadata.md)
- [*ProBasicMetadata* requirements](ProBasicMetadata.md)
- [*ProMetadata* requirements](ProMetadata.md)
9 changes: 5 additions & 4 deletions docs/spec/ProOverload.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Named requirements: *ProOverload*

A type `O` meets the *ProOverload* requirements if `substituted-overload<O, F>` matches one of the following definitions, where `F` is any type meeting the [*ProBasicFacade* requirements](ProBasicFacade.md), `R` is the *return type*, `Args...` are the *argument types*.
A type `O` meets the *ProOverload* requirements if `substituted-overload<O, F, MP>` matches one of the following definitions, where `F` is any type meeting the [*ProBasicFacade* requirements](ProBasicFacade.md), `MP` is any type meeting the [*ProMetadataPolicy* requirements](ProMetadataPolicy.md), `R` is the *return type*, `Args...` are the *argument types*.

The exposition-only type `substituted-overload<O, F>` is `OT<F>` if `O` is a specialization of [`facade_aware_overload_t<OT>`](facade_aware_overload_t.md), or `O` otherwise.
*Since 5.0.0*: the exposition-only type `substituted-overload<O, F, MP>` is `OT<F, MP>` if `O` is a specialization of [`proxy_dependent_signature<OT>`](proxy_dependent_signature.md), or `O` otherwise. Previously the exposition-only type was `substituted-overload<O, F>`, and `OT` was instantiated with `F` only.

| Definitions of `substituted-overload<O, F>` |
| ------------------------------------------- |
| Definitions of `substituted-overload<O, F, MP>` |
| ----------------------------------------------- |
| `R(Args...)` |
| `R(Args...) noexcept` |
| `R(Args...) &` |
Expand All @@ -22,4 +22,5 @@ The exposition-only type `substituted-overload<O, F>` is `OT<F>` if `O` is a spe
## See Also

- [*ProConvention* requirements](ProConvention.md)
- [*ProMetadataPolicy* requirements](ProMetadataPolicy.md)
- [class template `std::move_only_function`](https://en.cppreference.com/w/cpp/utility/functional/move_only_function)
4 changes: 2 additions & 2 deletions docs/spec/ProReflection.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ A type `R` meets the *ProReflection* requirements of a type `P` if `R` meets the

| Expressions | Semantics |
| --------------------------------------------------- | ------------------------------------------------------------ |
| `typename R::reflector_type(std::in_place_type<T>)` | Constructs a value of type `typename R::reflector_type`, reflecting implementation-defined metadata of type `T`. `typename R::reflector_type` shall meet the [*ProMeta* requirements](ProMeta.md) of `T` *(since 5.0.0)*. |
| `typename R::reflector_type(std::in_place_type<T>)` | Constructs a value of type `typename R::reflector_type`, reflecting implementation-defined metadata of type `T`. `typename R::reflector_type` shall meet the [*ProMetadata* requirements](ProMetadata.md) of `T` *(since 5.0.0)*. |

## See Also

- [*ProFacade* requirements](ProFacade.md)
- [*ProMeta* requirements](ProMeta.md)
- [*ProMetadata* requirements](ProMetadata.md)
Loading
Loading