Skip to content

Commit 3d7d464

Browse files
committed
feat(hash): update link
1 parent 35e9b89 commit 3d7d464

File tree

1 file changed

+39
-46
lines changed
  • src/content/docs/cpp/library/utility

1 file changed

+39
-46
lines changed

src/content/docs/cpp/library/utility/hash.mdx

Lines changed: 39 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,31 @@ import Missing from "@components/Missing.astro";
1212
import { ParamDoc, ParamDocList } from "@components/param-doc";
1313
import { Revision, RevisionBlock } from "@components/revision";
1414
import DocLink from "@components/DocLink.astro"
15+
import { Card } from "@astrojs/starlight/components";
16+
import FlexTable from "@components/FlexTable.astro";
17+
18+
<Card title="Defined in header">
19+
<FlexTable>
20+
<CppHeader name="bitset" />
21+
<CppHeader name="coroutine" />
22+
<CppHeader name="chrono" />
23+
<CppHeader name="filesystem" />
24+
<CppHeader name="functional" />
25+
<CppHeader name="memory" />
26+
<CppHeader name="optional" />
27+
<CppHeader name="stacktrace" />
28+
<CppHeader name="string" />
29+
<CppHeader name="string_view" />
30+
<CppHeader name="system_error" />
31+
<CppHeader name="text_encoding" />
32+
<CppHeader name="thread" />
33+
<CppHeader name="typeindex" />
34+
<CppHeader name="variant" />
35+
<CppHeader name="vector" />
36+
</FlexTable>
37+
</Card>
1538

16-
Defined in header <CppHeader name="bitset" />.
1739

18-
Defined in header <CppHeader name="coroutine" />.
19-
20-
Defined in header <CppHeader name="chrono" />.
21-
22-
Defined in header <CppHeader name="filesystem" />.
23-
24-
Defined in header <CppHeader name="functional" />.
25-
26-
Defined in header <CppHeader name="memory" />.
27-
28-
Defined in header <CppHeader name="optional" />.
29-
30-
Defined in header <CppHeader name="stacktrace" />.
31-
32-
Defined in header <CppHeader name="string" />.
33-
34-
Defined in header <CppHeader name="string_view" />.
35-
36-
Defined in header <CppHeader name="system_error" />.
37-
38-
Defined in header <CppHeader name="text_encoding" />.
39-
40-
Defined in header <CppHeader name="thread" />.
41-
42-
Defined in header <CppHeader name="typeindex" />.
43-
44-
Defined in header <CppHeader name="variant" />.
45-
46-
Defined in header <CppHeader name="vector" />.
4740

4841
<DeclDoc>
4942
<Decl slot="decl">
@@ -60,24 +53,24 @@ Defined in header <CppHeader name="vector" />.
6053

6154
Given a type `Key`, each specialization `std::hash<Key>` is either _enabled_ or _disabled_ :
6255

63-
- If `std::hash<Key>` is not provided by the program or the user, it is disabled.
64-
- Otherwise, `std::hash<Key>` is enabled if all following conditions are satisfied:
65-
- All following requirements are satisfied:
66-
- [Hash](../named_req/Hash.html "cpp/named req/Hash") (with `Key` as the function call argument type)
67-
- [DefaultConstructible](../named_req/DefaultConstructible.html "cpp/named req/DefaultConstructible")
68-
- [CopyAssignable](../named_req/CopyAssignable.html "cpp/named req/CopyAssignable")
69-
- [Swappable](../named_req/Swappable.html "cpp/named req/Swappable")
70-
71-
- Given the following values:
72-
- `h`, an object of type `std::hash<Key>`.
73-
- `k1` and `k2`, objects of type `Key`.
56+
- If `std::hash<Key>` is not provided by the program or the user, it is disabled.
57+
- Otherwise, `std::hash<Key>` is enabled if all following conditions are satisfied:
58+
- All following requirements are satisfied:
59+
- <DocLink dest="/cpp/language/named_req/Hash"> `Hash` </DocLink> (with `Key` as the function call argument type)
60+
- <DocLink dest="/cpp/language/named_req/DefaultConstructible"> `DefaultConstructible` </DocLink>
61+
- [CopyAssignable](../named_req/CopyAssignable.html "cpp/named req/CopyAssignable")
62+
- [Swappable](../named_req/Swappable.html "cpp/named req/Swappable")
63+
64+
- Given the following values:
65+
- `h`, an object of type `std::hash<Key>`.
66+
- `k1` and `k2`, objects of type `Key`.
7467
All following requirements are satisfied:
75-
- If `k1 == k2` is true, `h(k1) == h(k2)` is also true.
76-
- Unless `std::hash<Key>` is a [program-defined specialization](../language/type-id.html#Program-defined_type "cpp/language/type"), h(k1) will never throw an exception.
68+
- If `k1 == k2` is true, `h(k1) == h(k2)` is also true.
69+
- Unless `std::hash<Key>` is a [program-defined specialization](../language/type-id.html#Program-defined_type "cpp/language/type"), h(k1) will never throw an exception.
7770

7871
- Otherwise, `std::hash<Key>` is disabled.
7972

80-
Disabled specializations do not satisfy [Hash](../named_req/Hash.html "cpp/named req/Hash"), do not satisfy [FunctionObject](../named_req/FunctionObject.html "cpp/named req/FunctionObject"), and following values are all false:
73+
Disabled specializations do not satisfy <DocLink dest="/cpp/language/named_req/Hash"> `Hash` </DocLink>, do not satisfy [FunctionObject](../named_req/FunctionObject.html "cpp/named req/FunctionObject"), and following values are all false:
8174

8275
- `std::is_default_constructible<std::hash<Key>>::value`
8376
- `std::is_copy_constructible<std::hash<Key>>::value`
@@ -92,8 +85,8 @@ In other words, they exist, but cannot be used.
9285
Nested types:
9386
|Name|Definition|
9487
|---|---|
95-
|`argument_type` (deprecared in C++ 17)| Key|
96-
|`result_type` (deprecared in C++ 17)| size_t|
88+
|`argument_type` (deprecared in C++ 17)| `Key`|
89+
|`result_type` (deprecared in C++ 17)| `size_t`|
9790
</RevisionBlock>
9891
</Decl>
9992
</DeclDoc>

0 commit comments

Comments
 (0)