From a2dee4c3155a5892ea8e09f4d1712e0b60985dea Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 13:16:19 +0200 Subject: Add move constructors that VC12 doesn't provide implicitly --- common/view/olv/test1.hxx | 32 ++++++++++++++++++++++++++++++++ common/view/olv/test7.hxx | 6 ++++++ common/view/olv/test8.hxx | 6 ++++++ 3 files changed, 44 insertions(+) (limited to 'common/view') diff --git a/common/view/olv/test1.hxx b/common/view/olv/test1.hxx index eaec7e1..d07ada4 100644 --- a/common/view/olv/test1.hxx +++ b/common/view/olv/test1.hxx @@ -7,6 +7,7 @@ #include #include // unique_ptr +#include // std::move #include @@ -40,12 +41,22 @@ namespace test1 #pragma db view object(object1) object(object2: object1::id == object2::id) struct view1 { + // VC12 workaround (no default move constructor generation). + // + view1 () {} + view1 (view1&& x): o2 (std::move (x.o2)) {} + std::unique_ptr o2; }; #pragma db view object(object1) object(object2: object1::id == object2::id) struct view2 { + // VC12 workaround (no default move constructor generation). + // + view2 () {} + view2 (view2&& x): o2 (std::move (x.o2)), o1 (std::move (x.o1)) {} + std::unique_ptr o2; std::unique_ptr o1; }; @@ -53,6 +64,11 @@ namespace test1 #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) struct view3 { + // VC12 workaround (no default move constructor generation). + // + view3 () {} + view3 (view3&& x): o1 (std::move (x.o1)), o2 (std::move (x.o2)) {} + std::unique_ptr o1; std::unique_ptr o2; }; @@ -60,6 +76,15 @@ namespace test1 #pragma db view object(object1 = o1) object(object2 = o2: o1::id == o2::id) struct view4 { + // VC12 workaround (no default move constructor generation). + // + view4 () {} + view4 (view4&& x): s (std::move (x.s)), + o2 (std::move (x.o2)), + id (x.id), + o1 (std::move (x.o1)), + n (x.n) {} + std::string s; std::unique_ptr o2; @@ -76,6 +101,13 @@ namespace test1 object(object1 = o1b: object1::id == o1b::n) struct view5 { + // VC12 workaround (no default move constructor generation). + // + view5 () {} + view5 (view5&& x): o1a (std::move (x.o1a)), + o2 (std::move (x.o2)), + o1b (std::move (x.o1b)) {} + std::unique_ptr o1a; std::unique_ptr o2; std::unique_ptr o1b; diff --git a/common/view/olv/test7.hxx b/common/view/olv/test7.hxx index 83bd5e7..dcfac32 100644 --- a/common/view/olv/test7.hxx +++ b/common/view/olv/test7.hxx @@ -7,6 +7,7 @@ #include #include // unique_ptr +#include // std::move #include @@ -44,6 +45,11 @@ namespace test7 #pragma db view object(object1) object(object2) struct view1 { + // VC12 workaround (no default move constructor generation). + // + view1 () {} + view1 (view1&& x): o2 (std::move (x.o2)), o1 (std::move (x.o1)) {} + unique_ptr o2; unique_ptr o1; }; diff --git a/common/view/olv/test8.hxx b/common/view/olv/test8.hxx index d130b79..23cd82e 100644 --- a/common/view/olv/test8.hxx +++ b/common/view/olv/test8.hxx @@ -7,6 +7,7 @@ #include #include // unique_ptr +#include // std::move #include @@ -41,6 +42,11 @@ namespace test8 #pragma db view object(object1) object(object2) struct view1 { + // VC12 workaround (no default move constructor generation). + // + view1 () {} + view1 (view1&& x): o2 (std::move (x.o2)), o1 (std::move (x.o1)) {} + unique_ptr o2; unique_ptr o1; }; -- cgit v1.1