summaryrefslogtreecommitdiff
path: root/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:47:26 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:47:26 +0000
commit51072bd6bf79ef2bc6a922079bff57c31c1effbc (patch)
tree91a2effbc9e6f80bdbbf9eb70e06c51ad0867ea0 /test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp
parentbb5e33f003797b67974a8893f7f2930fc51b8210 (diff)
Notes
Diffstat (limited to 'test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp')
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp
index 3a6abd3a95af..8423f5d0145f 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_move.pass.cpp
@@ -20,6 +20,16 @@
#include <memory>
#include <cassert>
+struct Explicit {
+ int value;
+ explicit Explicit(int x) : value(x) {}
+};
+
+struct Implicit {
+ int value;
+ Implicit(int x) : value(x) {}
+};
+
struct B
{
int id_;
@@ -81,4 +91,14 @@ int main()
assert(std::get<1>(t1) == int('a'));
assert(std::get<2>(t1)->id_ == 3);
}
+ {
+ std::tuple<int> t1(42);
+ std::tuple<Explicit> t2(std::move(t1));
+ assert(std::get<0>(t2).value == 42);
+ }
+ {
+ std::tuple<int> t1(42);
+ std::tuple<Implicit> t2 = std::move(t1);
+ assert(std::get<0>(t2).value == 42);
+ }
}