0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

g++ でありがたいことがある。

コンパイルすると、includeファイルが足りないと、候補を示してくれる。

これむっちゃ助かる。

22.6.3.7 Swap [variant.swap] C++N4910:2022 (567) p707a.cpp

bash
$ g++ p707a.cpp -std=2b -o p707ag -I. -Wall
p707a.cpp:28:162: error: too many decimal points in number
   28 | onstructible_v<Ti> is true for all i. Preconditions: Lvalues of type Ti are swappable (16.4.4.3).
      |                                                                                        ^~~~~~~~

p707a.cpp:28:16: error: variable or field 'swap' declared void
   28 | constexpr void swap(variant& rhs) noexcept(see below); Mandates: is_move_constructible_v<Ti> is true for all i. Preconditions: Lvalues of type Ti are swappable (16.4.4.3).
      |                ^~~~
p707a.cpp:28:21: error: 'variant' was not declared in this scope
   28 | constexpr void swap(variant& rhs) noexcept(see below); Mandates: is_move_constructible_v<Ti> is true for all i. Preconditions: Lvalues of type Ti are swappable (16.4.4.3).
      |                     ^~~~~~~
p707a.cpp:23:1: note: 'std::variant' is defined in header '<variant>'; did you forget to '#include <variant>'?
   22 | #include <memory>
  +++ |+#include <variant>
   23 | #include <typeinfo>
p707a.cpp:28:30: error: 'rhs' was not declared in this scope
   28 | constexpr void swap(variant& rhs) noexcept(see below); Mandates: is_move_constructible_v<Ti> is true for all i. Preconditions: Lvalues of type Ti are swappable (16.4.4.3).
      |                              ^~~
p707a.cpp:28:64: error: found ':' in nested-name-specifier, expected '::'
   28 | constexpr void swap(variant& rhs) noexcept(see below); Mandates: is_move_constructible_v<Ti> is true for all i. Preconditions: Lvalues of type Ti are swappable (16.4.4.3).
      |                                                                ^
      |                                                                ::
p707a.cpp:28:56: error: 'Mandates' does not name a type
   28 | constexpr void swap(variant& rhs) noexcept(see below); Mandates: is_move_constructible_v<Ti> is true for all i. Preconditions: Lvalues of type Ti are swappable (16.4.4.3).
      |       
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?