aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-02-08 13:16:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-02-08 13:16:19 +0200
commita2dee4c3155a5892ea8e09f4d1712e0b60985dea (patch)
treeb474836d37bcb3b766aab47bc92b85bcf11c20f3
parent10be61ad26034a574a013c979549aaedf9aa8382 (diff)
Add move constructors that VC12 doesn't provide implicitly
-rw-r--r--common/view/olv/test1.hxx32
-rw-r--r--common/view/olv/test7.hxx6
-rw-r--r--common/view/olv/test8.hxx6
3 files changed, 44 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;
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 <string>
#include <memory> // unique_ptr
+#include <utility> // std::move
#include <odb/core.hxx>
@@ -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<object2> o2;
unique_ptr<object1> 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 <string>
#include <memory> // unique_ptr
+#include <utility> // std::move
#include <odb/core.hxx>
@@ -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<object2> o2;
unique_ptr<object1> o1;
};