Skip to content

Fix wrong operator links and clean up <variant> header reference #5656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
44 changes: 22 additions & 22 deletions docs/standard-library/variant.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,56 @@ A variant object holds and manages a value. If the variant holds a value, that v

## Requirements

**Header:** \<variant>
**Header:** `<variant>`

**Namespace:** std
**Namespace:** `std`

## Members

### Operators

|Name|Description|
|-|-|
|[operator==](../standard-library/forward-list-operators.md#op_eq_eq)|Tests if the variant object on the left side of the operator is equal to the variant object on the right side.|
|[operator!=](../standard-library/forward-list-operators.md#op_neq)|Tests if the variant object on the left side of the operator is not equal to the variant object on the right side.|
|[operator<](../standard-library/forward-list-operators.md#op_lt)|Tests if the variant object on the left side of the operator is less than the variant object on the right side.|
|[operator<=](../standard-library/forward-list-operators.md#op_lt_eq)|Tests if the variant object on the left side of the operator is less than or equal to the variant object on the right side.|
|[operator>](../standard-library/forward-list-operators.md#op_gt)|Tests if the variant object on the left side of the operator is greater than the variant object on the right side.|
|[operator>=](../standard-library/forward-list-operators.md#op_gt_eq)|Tests if the variant object on the left side of the operator is greater than or equal to the variant object on the right side.|
|[`operator==`](variant-operators.md#op_eq_eq)|Tests if the variant object on the left side of the operator is equal to the variant object on the right side.|
|[`operator!=`](variant-operators.md#op_neq)|Tests if the variant object on the left side of the operator is not equal to the variant object on the right side.|
|[`operator<`](variant-operators.md#op_lt)|Tests if the variant object on the left side of the operator is less than the variant object on the right side.|
|[`operator<=`](variant-operators.md#op_lt_eq)|Tests if the variant object on the left side of the operator is less than or equal to the variant object on the right side.|
|[`operator>`](variant-operators.md#op_gt)|Tests if the variant object on the left side of the operator is greater than the variant object on the right side.|
|[`operator>=`](variant-operators.md#op_gt_eq)|Tests if the variant object on the left side of the operator is greater than or equal to the variant object on the right side.|

### Functions

|Name|Description|
|-|-|
|[get](../standard-library/variant-functions.md#get)|Gets the variant of an object.|
|[get_if](../standard-library/variant-functions.md#get_if)|Gets the variant of an object if it exists.|
|[holds_alternative](../standard-library/variant-functions.md#holds_alternative)|Return **`true`** if a variant exists.|
|[swap](../standard-library/variant-functions.md#swap)|Swaps a **variant**.|
|[visit](../standard-library/variant-functions.md#visit)|Moves to the next **variant**.|
|[`get`](variant-functions.md#get)|Gets the variant of an object.|
|[`get_if`](variant-functions.md#get_if)|Gets the variant of an object if it exists.|
|[`holds_alternative`](variant-functions.md#holds_alternative)|Return **`true`** if a variant exists.|
|[`swap`](variant-functions.md#swap)|Swaps a **variant**.|
|[`visit`](variant-functions.md#visit)|Moves to the next **variant**.|

### Classes

|Name|Description|
|-|-|
|[bad_variant_access](../standard-library/bad-variant-access-class.md)|Objects thrown to report invalid accesses to the value of a variant object.|
|[variant](../standard-library/variant.md)|An object to either hold a value of one of its alternative types, or no value.|
|[`bad_variant_access`](bad-variant-access-class.md)|Objects thrown to report invalid accesses to the value of a variant object.|
|[`variant`](variant-class.md)|An object to either hold a value of one of its alternative types, or no value.|
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found another wrong link here, this should not point to itself.


### Structs

|Name|Description|
|-|-|
|[hash](../standard-library/hash-structure.md)||
|[monostate](../standard-library/monostate-structure.md)|An alternative type for a variant to make the variant type default constructible.|
|[uses_allocator](../standard-library/uses-allocator-structure.md)||
|[variant_alternative](../standard-library/variant-alternative-structure.md)|Assists the variant objects.|
|[variant_size](../standard-library/variant-size-structure.md)|Assists the variant objects.|
|[`hash`](hash-structure.md)||
|[`monostate`](monostate-structure.md)|An alternative type for a variant to make the variant type default constructible.|
|[`uses_allocator`](uses-allocator-structure.md)||
|[`variant_alternative`](variant-alternative-structure.md)|Assists the variant objects.|
|[`variant_size`](variant-size-structure.md)|Assists the variant objects.|

### Objects

|Name|Description|
|-|-|
|[variant_npos](../standard-library/variant-functions.md#variant_npos)||
|[`variant_npos`](variant-functions.md#variant_npos)||

## See also

[Header Files Reference](../standard-library/cpp-standard-library-header-files.md)
[Header Files Reference](cpp-standard-library-header-files.md)