libstdc++-v3/testsuite/23_containers/vector/bool/emplace_rvalue.cc
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | |
| 3 | #include <vector> |
| 4 | |
| 5 | struct S |
| 6 | { |
| 7 | explicit operator bool() &&; |
| 8 | }; |
| 9 | |
| 10 | void |
| 11 | test_emplace_back() |
| 12 | { |
| 13 | S s; |
| 14 | std::vector<bool> v; |
| 15 | v.emplace_back(std::move(s)); |
| 16 | } |
| 17 | |
| 18 | void |
| 19 | test_emplace() |
| 20 | { |
| 21 | S s; |
| 22 | std::vector<bool> v; |
| 23 | v.emplace(v.begin(), std::move(s)); |
| 24 | } |