Skip to content

Commit

Permalink
Fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxwa committed Dec 15, 2024
1 parent 6462054 commit ba0aa50
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions docs/proxy/indirection.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
# `proxy::operator->`, `proxy::operator*`

The definitions of `proxy::operator->` and `proxy::operator*` make use of the following exposition-only constant and type alias:
The definitions of `proxy::operator->` and `proxy::operator*` make use of the following exposition-only constant:

```cpp
static constexpr bool has-indirection = see below; // exposition only
using indirect-accessor = see below; // exposition only
```

As per [`facade<F>`](../facade.md), `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`. Let `Cs2` be the types in `Cs` where each type `C` meets the [*ProAccessible* requirements](../ProAccessible.md) of `F` and `C::is_direct` is `false`. *has-indirection* is `true` if `Cs2` contains at least one type; otherwise, it is `false`. *indirect-accessor* is a non-copyable type that inherits from every type in `Cs2`.

```cpp
// (1)
indirect-accessor* operator->() noexcept requires(has-indirection);
const indirect-accessor* operator->() const noexcept requires(has-indirection);
proxy_indirect_accessor<F>* operator->() noexcept requires(has-indirection);
const proxy_indirect_accessor<F>* operator->() const noexcept requires(has-indirection);

// (2)
indirect-accessor& operator*() & noexcept requires(has-indirection);
const indirect-accessor& operator*() const& noexcept requires(has-indirection);
indirect-accessor&& operator*() && noexcept requires(has-indirection);
const indirect-accessor&& operator*() const&& noexcept requires(has-indirection);
proxy_indirect_accessor<F>& operator*() & noexcept requires(has-indirection);
const proxy_indirect_accessor<F>& operator*() const& noexcept requires(has-indirection);
proxy_indirect_accessor<F>&& operator*() && noexcept requires(has-indirection);
const proxy_indirect_accessor<F>&& operator*() const&& noexcept requires(has-indirection);
```
These operators access the accessors of the indirect conventions, as if dereferencing the contained value.
- `(1)` Returns a pointer to the *indirect-accessor*.
- `(2)` Returns a reference to the *indirect-accessor*.
- `(1)` Returns a pointer to the `proxy_indirect_accessor<F>`.
- `(2)` Returns a reference to the `proxy_indirect_accessor<F>`.
The behavior is undefined if `*this` does not contain a value.
Expand Down Expand Up @@ -68,3 +67,4 @@ int main() {

- [function template `access_proxy`](../access_proxy.md)
- [function template `proxy_invoke`](../proxy_invoke.md)
- [class template `proxy_indirect_accessor`](../proxy_indirect_accessor.md)
2 changes: 1 addition & 1 deletion docs/specifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This document provides the API specifications for the C++ library Proxy (version
| [`operator_dispatch`](operator_dispatch.md) | Dispatch type for operator expressions with accessibility |
| [`explicit_conversion_dispatch`<br />`conversion_dispatch`](explicit_conversion_dispatch.md) | Dispatch type for explicit conversion expressions with accessibility |
| [`implicit_conversion_dispatch`](implicit_conversion_dispatch.md) | Dispatch type for implicit conversion expressions with accessibility |
| [`proxy_indirect_accessor`](proxy_indirect_accessor.md) | Provides indirection accessibility for `proxy` types |
| [`proxy_indirect_accessor`](proxy_indirect_accessor.md) | Provides indirection accessibility for `proxy` |

## Functions

Expand Down

0 comments on commit ba0aa50

Please sign in to comment.