From Jason Turner

[expected.bad]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpcjv4pc2c/{from.md → to.md} +14 -13
tmp/tmpcjv4pc2c/{from.md → to.md} RENAMED
@@ -3,16 +3,16 @@
3
  ``` cpp
4
  namespace std {
5
  template<class E>
6
  class bad_expected_access : public bad_expected_access<void> {
7
  public:
8
- explicit bad_expected_access(E);
9
- const char* what() const noexcept override;
10
- E& error() & noexcept;
11
- const E& error() const & noexcept;
12
- E&& error() && noexcept;
13
- const E&& error() const && noexcept;
14
 
15
  private:
16
  E unex; // exposition only
17
  };
18
  }
@@ -22,30 +22,31 @@ The class template `bad_expected_access` defines the type of objects
22
  thrown as exceptions to report the situation where an attempt is made to
23
  access the value of an `expected<T, E>` object for which `has_value()`
24
  is `false`.
25
 
26
  ``` cpp
27
- explicit bad_expected_access(E e);
28
  ```
29
 
30
  *Effects:* Initializes *unex* with `std::move(e)`.
31
 
32
  ``` cpp
33
- const E& error() const & noexcept;
34
- E& error() & noexcept;
35
  ```
36
 
37
  *Returns:* *unex*.
38
 
39
  ``` cpp
40
- E&& error() && noexcept;
41
- const E&& error() const && noexcept;
42
  ```
43
 
44
  *Returns:* `std::move(`*`unex`*`)`.
45
 
46
  ``` cpp
47
- const char* what() const noexcept override;
48
  ```
49
 
50
- *Returns:* An implementation-defined NTBS.
 
51
 
 
3
  ``` cpp
4
  namespace std {
5
  template<class E>
6
  class bad_expected_access : public bad_expected_access<void> {
7
  public:
8
+ constexpr explicit bad_expected_access(E);
9
+ constexpr const char* what() const noexcept override;
10
+ constexpr E& error() & noexcept;
11
+ constexpr const E& error() const & noexcept;
12
+ constexpr E&& error() && noexcept;
13
+ constexpr const E&& error() const && noexcept;
14
 
15
  private:
16
  E unex; // exposition only
17
  };
18
  }
 
22
  thrown as exceptions to report the situation where an attempt is made to
23
  access the value of an `expected<T, E>` object for which `has_value()`
24
  is `false`.
25
 
26
  ``` cpp
27
+ constexpr explicit bad_expected_access(E e);
28
  ```
29
 
30
  *Effects:* Initializes *unex* with `std::move(e)`.
31
 
32
  ``` cpp
33
+ constexpr const E& error() const & noexcept;
34
+ constexpr E& error() & noexcept;
35
  ```
36
 
37
  *Returns:* *unex*.
38
 
39
  ``` cpp
40
+ constexpr E&& error() && noexcept;
41
+ constexpr const E&& error() const && noexcept;
42
  ```
43
 
44
  *Returns:* `std::move(`*`unex`*`)`.
45
 
46
  ``` cpp
47
+ constexpr const char* what() const noexcept override;
48
  ```
49
 
50
+ *Returns:* An *implementation-defined* NTBS, which during constant
51
+ evaluation is encoded with the ordinary literal encoding [[lex.ccon]].
52