diff --git a/docs/spec/explicit_conversion_dispatch/accessor.md b/docs/spec/explicit_conversion_dispatch/accessor.md index 7a22671..9801337 100644 --- a/docs/spec/explicit_conversion_dispatch/accessor.md +++ b/docs/spec/explicit_conversion_dispatch/accessor.md @@ -25,4 +25,4 @@ struct accessor { `(2)` When `sizeof...(Os)` is greater than `1`, and `accessor...` are default-constructible, inherits all `accessor...` types and `using` their `operator return-type-of`. `return-type-of` denotes the *return type* of the overload type `O`. -`(3)` When `sizeof...(Os)` is `1` and the only type `O` in `Os` is `T() cv ref noex`, provides an explicit `operator T()` with the same *cv ref noex* specifiers. `accessor::operator T()` is equivalent to `return invoke(static_cast

>(*this))`. +`(3)` When `sizeof...(Os)` is `1` and the only type `O` in `Os` is `T() cv ref noex`, provides an explicit `operator T()` with the same *cv ref noex* specifiers. `accessor::operator T()` is equivalent to `return invoke(static_cast

>(*this))`. diff --git a/docs/spec/implicit_conversion_dispatch/accessor.md b/docs/spec/implicit_conversion_dispatch/accessor.md index 15cadf3..a1efc20 100644 --- a/docs/spec/implicit_conversion_dispatch/accessor.md +++ b/docs/spec/implicit_conversion_dispatch/accessor.md @@ -25,4 +25,4 @@ struct accessor { `(2)` When `sizeof...(Os)` is greater than `1`, and `accessor...` are default-constructible, inherits all `accessor...` types and `using` their `operator return-type-of`. `return-type-of` denotes the *return type* of the overload type `O`. -`(3)` When `sizeof...(Os)` is `1` and the only type `O` in `Os` is `T() cv ref noex`, provides an implicit `operator T()` with the same *cv ref noex* specifiers. `accessor::operator T()` is equivalent to `return invoke(static_cast

>(*this))`. +`(3)` When `sizeof...(Os)` is `1` and the only type `O` in `Os` is `T() cv ref noex`, provides an implicit `operator T()` with the same *cv ref noex* specifiers. `accessor::operator T()` is equivalent to `return invoke(static_cast

>(*this))`. diff --git a/docs/spec/operator_dispatch/README.md b/docs/spec/operator_dispatch/README.md index ab2cbc0..f2d2b9f 100644 --- a/docs/spec/operator_dispatch/README.md +++ b/docs/spec/operator_dispatch/README.md @@ -54,7 +54,7 @@ Let `self` be the operand of [`proxy`](../proxy/README.md), and `other` and `oth | `operator_dispatch<"!", false>` | `!self` | | `operator_dispatch<"&&", false>` | `self && other` | | `operator_dispatch<"||", false>` | `self || other` | -| `operator_dispatch<"~", false>` | `!self` | +| `operator_dispatch<"~", false>` | `~self` | | `operator_dispatch<"&", false>` | `&self`, `self & other` | | `operator_dispatch<"|", false>` | `self | other` | | `operator_dispatch<"^", false>` | `self ^ other` | diff --git a/docs/spec/operator_dispatch/accessor.md b/docs/spec/operator_dispatch/accessor.md index c4ea650..2362ede 100644 --- a/docs/spec/operator_dispatch/accessor.md +++ b/docs/spec/operator_dispatch/accessor.md @@ -29,56 +29,78 @@ When `Rhs` is `false`, the other specializations are defined as follows, where ` ### Regular SOPs -When `Sign` is one of `"+"`, `"-"`, `"*"`, `"/"`, `"%"`, `"++"`, `"--"`, `"=="`, `"!="`, `">"`, `"<"`, `">="`, `"<="`, `"<=>"`, `"&&"`, `"||"`, `"&"`, `"|"`, `"^"`, `"<<"`, `">>"`, `","`, `"->*"`, `"()"`, `"[]"`, +When `Sign` is one of `"+"`, `"-"`, `"*"`, `"/"`, `"%"`, `"=="`, `"!="`, `">"`, `"<"`, `">="`, `"<="`, `"<=>"`, `"&&"`, `"||"`, `"&"`, `"|"`, `"^"`, `"<<"`, `">>"`, `","`, `"->*"`, `"()"`, `"[]"`, ```cpp // (3) template struct accessor { R operator sop (Args... args) cv ref noex; -} +}; ``` `(3)` Provides an `operator sop(Args...)` with the same *cv ref noex* specifiers as of the overload type. `accessor::operator sop(Args...)` is equivalent to `return invoke(static_cast

>(*this), std::forward(args)...)`. -### `!` and `~` +### `"!"` and `"~"` -When `Sign` is either `!` and `~`, +When `Sign` is either `"!"` or `"~"`, ```cpp // (4) template struct accessor { R operator sop () cv ref noex; -} +}; ``` `(4)` Provides an `operator sop()` with the same *cv ref noex* specifiers as of the overload type. `accessor::operator sop()` is equivalent to `return invoke(static_cast

>(*this))`. +### `"++"` and `"--"` + +When `Sign` is either `"++"` or `"--"`, + +```cpp +// (5) +template +struct accessor { + /* see below */ operator sop () cv ref noex; +}; + +// (6) +template +struct accessor { + R operator sop (int) cv ref noex; +}; +``` + +`(5)` Provides a prefix `operator sop()` with the same *cv ref noex* specifiers as of the overload type. `accessor::operator sop()` calls `invoke(static_cast

>(*this))` and returns `static_cast

>(*this)`. + +`(6)` Provides a postfix `operator sop(int)` with the same *cv ref noex* specifiers as of the overload type. `accessor::operator sop(int)` is equivalent to `return invoke(static_cast

>(*this), 0)`. + ### Assignment SOPs When `Sign` is one of `"+="`, `"-="`, `"*="`, `"/="`, `"%="`, `"&="`, `"|="`, `"^="`, `"<<="`, `">>="`, ```cpp -// (5) +// (7) template struct accessor { /* see below */ operator sop (Arg arg) cv ref noex; -} +}; ``` -`(4)` Provides an `operator sop(Arg)` with the same *cv ref noex* specifiers as of the overload type. `accessor::operator sop(Arg)` calls `invoke(static_cast

>(*this), std::forward(arg))` and returns `static_cast

>(*this)`. +`(7)` Provides an `operator sop(Arg)` with the same *cv ref noex* specifiers as of the overload type. `accessor::operator sop(Arg)` calls `invoke(static_cast

>(*this), std::forward(arg))` and returns `static_cast

>(*this)`. ## Right-Hand-Side Operand Specializations ```cpp -// (6) +// (8) template requires(sizeof...(Os) > 1u && (std::is_constructible_v> && ...)) struct accessor : accessor... {}; ``` -`(6)` When `sizeof...(Os)` is greater than `1`, and `accessor...` are default-constructible types, inherits all `accessor...` types. +`(8)` When `sizeof...(Os)` is greater than `1`, and `accessor...` are default-constructible types, inherits all `accessor...` types. When `Rhs` is `true`, the other specializations are defined as follows, where `sizeof...(Os)` is `1` and the only type `O` qualified with `cv ref noex`: @@ -87,25 +109,25 @@ When `Rhs` is `true`, the other specializations are defined as follows, where `s When `Sign` is one of `"+"`, `"-"`, `"*"`, `"/"`, `"%"`, `"=="`, `"!="`, `">"`, `"<"`, `">="`, `"<="`, `"<=>"`, `"&&"`, `"||"`, `"&"`, `"|"`, `"^"`, `"<<"`, `">>"`, `","`, `"->*"`, ```cpp -// (7) +// (9) template struct accessor { friend R operator sop (Arg arg, P cv self) noex; -} +}; ``` -`(7)` Provides a `friend operator sop(Arg arg, P cv self)` with the same *noex* specifiers as of the overload type. `accessor::operator sop(Arg arg, P cv self)` is equivalent to `return invoke(static_cast

>(self), std::forward(arg))`. +`(9)` Provides a `friend operator sop(Arg arg, P cv self)` with the same *noex* specifiers as of the overload type. `accessor::operator sop(Arg arg, P cv self)` is equivalent to `return invoke(static_cast

>(self), std::forward(arg))`. ### Assignment SOPs When `Sign` is one of `"+="`, `"-="`, `"*="`, `"/="`, `"%="`, `"&="`, `"|="`, `"^="`, `"<<="`, `">>="`, ```cpp -// (8) +// (10) template -struct accessor { - friend /* see below */ operator sop (Arg arg, P cv self) noex; -} +struct accessor { + friend Arg& operator sop (Arg& arg, P cv self) noex; +}; ``` -`(8)` Provides a `friend operator sop(Arg arg, P cv self)` with the same *noex* specifiers as of the overload type. `accessor::operator sop(Arg arg, P cv self)` calls `invoke(static_cast

>(self), std::forward(arg))` and returns `static_cast

>(self)`. +`(10)` Provides a `friend operator sop(Arg& arg, P cv self)` with the same *noex* specifiers as of the overload type. `accessor::operator sop(Arg& arg, P cv self)` calls `invoke(static_cast

>(self), arg)` and returns `arg`.