Skip to content

Commit 8ddd727

Browse files
author
msebolt
committed
touchups
1 parent 30c7ffc commit 8ddd727

3 files changed

Lines changed: 27 additions & 4 deletions

File tree

docs/standard-library/optional-class.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ constexpr bool has_value() const noexcept;
6161

6262
## <a name="optional"></a> optional::optional
6363

64-
Constructs an object of type `optional`.
64+
Constructs an object of type `optional`. Also includes a destructor.
6565

6666
```cpp
6767
constexpr optional() noexcept;
@@ -79,6 +79,8 @@ template <class U>
7979
explicit optional(const optional<U>&);
8080
template <class U>
8181
explicit optional(optional<U>&&);
82+
83+
~optional();
8284
```
8385
8486
## <a name="op_eq"></a> optional::operator=

docs/standard-library/optional-functions.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ ms.assetid: 0d6bc656-7049-4651-a4bd-c9a805e47756
66
---
77
# &lt;optional&gt; functions
88

9-
||
10-
|-|
11-
|[make_optional](#make_optional)|
9+
||||
10+
|-|-|-|
11+
|[make_optional](#make_optional)|[nullopt](#nullopt)|[swap](#swap)|
1212

1313
## <a name="make_optional"></a> make_optional
1414

@@ -23,6 +23,19 @@ template <class T, class U, class... Args>
2323
constexpr optional<T> make_optional(initializer_list<U> il, Args&&... args);
2424
```
2525
26+
## <a name="nullopt"></a> nullopt
27+
28+
```cpp
29+
inline constexpr nullopt_t nullopt(unspecified );
30+
```
31+
32+
## <a name="swap"></a> swap
33+
34+
```cpp
35+
template <class T>
36+
void swap(optional<T>&, optional<T>&) noexcept(see below );
37+
```
38+
2639
## See also
2740
2841
[<optional>](../standard-library/optional.md)<br/>

docs/standard-library/optional.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,23 @@ Defines the container template class optional and several supporting templates.
3434
|Function|Description|
3535
|-|-|
3636
|[make_optional](../standard-library/optional-functions.md#make_optional)|Makes an object optional.|
37+
|[swap](../standard-library/optional-functions.md#swap)||
3738

3839
### Classes and Structs
3940

4041
|Class or Struct|Description|
4142
|-|-|
43+
|[hash]()||
4244
|[optional Class](../standard-library/optional-class.md)|Describes an object that may or may not hold a value.|
4345
|[nullopt_t Struct](../standard-library/nullopt-t-structure.md)|Describes an object not holding a value.|
4446
|[bad_optional_access Class](../standard-library/bad-optional-access-class.md)|Describes an object thrown as an exception to report an attempt to access a value not there.|
4547

48+
### Objects
49+
50+
|Object|Description|
51+
|-|-|
52+
|[nullopt](../standard-library/optional-functions.md#nullopt)||
53+
4654
## See also
4755

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

0 commit comments

Comments
 (0)