diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-08 13:16:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-08 13:16:19 +0200 |
commit | a2dee4c3155a5892ea8e09f4d1712e0b60985dea (patch) | |
tree | b474836d37bcb3b766aab47bc92b85bcf11c20f3 /common/view/olv/test1.hxx | |
parent | 10be61ad26034a574a013c979549aaedf9aa8382 (diff) |
Add move constructors that VC12 doesn't provide implicitly
Diffstat (limited to 'common/view/olv/test1.hxx')
-rw-r--r-- | common/view/olv/test1.hxx | 32 |
1 files changed, 32 insertions, 0 deletions
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 <string> #include <memory> // unique_ptr +#include <utility> // std::move #include <odb/core.hxx> @@ -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<object2> 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<object2> o2; std::unique_ptr<object1> 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<object1> o1; std::unique_ptr<object2> 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<object2> 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<object1> o1a; std::unique_ptr<object2> o2; std::unique_ptr<object1> o1b; |