forked from boostorg/variant2
Document operator<<
This commit is contained in:
@ -13,6 +13,7 @@ https://www.boost.org/LICENSE_1_0.txt
|
|||||||
* Added `<boost/variant2.hpp>`.
|
* Added `<boost/variant2.hpp>`.
|
||||||
* Added `unsafe_get<I>`.
|
* Added `unsafe_get<I>`.
|
||||||
* Added `visit_by_index`.
|
* Added `visit_by_index`.
|
||||||
|
* Added `operator<<`.
|
||||||
|
|
||||||
## Changes in 1.76.0
|
## Changes in 1.76.0
|
||||||
|
|
||||||
|
@ -144,6 +144,17 @@ template<class... T>
|
|||||||
template<class... T>
|
template<class... T>
|
||||||
constexpr bool operator>=(const variant<T...>& v, const variant<T...>& w);
|
constexpr bool operator>=(const variant<T...>& v, const variant<T...>& w);
|
||||||
|
|
||||||
|
// stream insertion (extension)
|
||||||
|
|
||||||
|
template<class Ch, class Tr, class... T>
|
||||||
|
std::basic_ostream<Ch, Tr>&
|
||||||
|
operator<<( std::basic_ostream<Ch, Tr>& os, variant<T...> const& v );
|
||||||
|
|
||||||
|
// swap
|
||||||
|
|
||||||
|
template<class... T>
|
||||||
|
void swap(variant<T...>& v, variant<T...>& w) noexcept( /*see below*/ );
|
||||||
|
|
||||||
// visit
|
// visit
|
||||||
|
|
||||||
template<class R = /*unspecified*/, class F, class... V>
|
template<class R = /*unspecified*/, class F, class... V>
|
||||||
@ -165,11 +176,6 @@ constexpr bool operator>(monostate, monostate) noexcept { return false; }
|
|||||||
constexpr bool operator<=(monostate, monostate) noexcept { return true; }
|
constexpr bool operator<=(monostate, monostate) noexcept { return true; }
|
||||||
constexpr bool operator>=(monostate, monostate) noexcept { return true; }
|
constexpr bool operator>=(monostate, monostate) noexcept { return true; }
|
||||||
|
|
||||||
// swap
|
|
||||||
|
|
||||||
template<class... T>
|
|
||||||
void swap(variant<T...>& v, variant<T...>& w) noexcept( /*see below*/ );
|
|
||||||
|
|
||||||
// bad_variant_access
|
// bad_variant_access
|
||||||
|
|
||||||
class bad_variant_access;
|
class bad_variant_access;
|
||||||
@ -880,6 +886,32 @@ template<class... T>
|
|||||||
Returns: ::
|
Returns: ::
|
||||||
`w \<= v`.
|
`w \<= v`.
|
||||||
|
|
||||||
|
### Stream Insertion (extension)
|
||||||
|
```
|
||||||
|
template<class Ch, class Tr, class... T>
|
||||||
|
std::basic_ostream<Ch, Tr>&
|
||||||
|
operator<<( std::basic_ostream<Ch, Tr>& os, variant<T...> const& v );
|
||||||
|
```
|
||||||
|
[none]
|
||||||
|
* {blank}
|
||||||
|
+
|
||||||
|
Requires: ::
|
||||||
|
`sizeof...(T) != 0`.
|
||||||
|
Returns: ::
|
||||||
|
`os << get<I>(v)`, where `I` is `v.index()`.
|
||||||
|
|
||||||
|
### swap
|
||||||
|
|
||||||
|
```
|
||||||
|
template<class... T>
|
||||||
|
void swap(variant<T...>& v, variant<T...>& w) noexcept( /*see below*/ );
|
||||||
|
```
|
||||||
|
[none]
|
||||||
|
* {blank}
|
||||||
|
+
|
||||||
|
Effects: ::
|
||||||
|
Equivalent to `v.swap(w)`.
|
||||||
|
|
||||||
### visit
|
### visit
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -914,18 +946,6 @@ Remarks: :: If `R` is given explicitly, as in `visit_by_index<int>`, the return
|
|||||||
of `Fi` to the corresponding variant alternatives must have the same return type
|
of `Fi` to the corresponding variant alternatives must have the same return type
|
||||||
for this deduction to succeed.
|
for this deduction to succeed.
|
||||||
|
|
||||||
### swap
|
|
||||||
|
|
||||||
```
|
|
||||||
template<class... T>
|
|
||||||
void swap(variant<T...>& v, variant<T...>& w) noexcept( /*see below*/ );
|
|
||||||
```
|
|
||||||
[none]
|
|
||||||
* {blank}
|
|
||||||
+
|
|
||||||
Effects: ::
|
|
||||||
Equivalent to `v.swap(w)`.
|
|
||||||
|
|
||||||
### bad_variant_access
|
### bad_variant_access
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user