aboutsummaryrefslogtreecommitdiff
path: root/common/container
diff options
context:
space:
mode:
Diffstat (limited to 'common/container')
-rw-r--r--common/container/change-tracking/driver.cxx15
-rw-r--r--common/container/change-tracking/test.hxx4
2 files changed, 18 insertions, 1 deletions
diff --git a/common/container/change-tracking/driver.cxx b/common/container/change-tracking/driver.cxx
index c5a43a4..3db728c 100644
--- a/common/container/change-tracking/driver.cxx
+++ b/common/container/change-tracking/driver.cxx
@@ -137,7 +137,11 @@ main (int argc, char* argv[])
//
{
transaction t (db->begin ());
+#ifdef HAVE_CXX11
+ unique_ptr<object> p (db->load<object> ("1"));
+#else
auto_ptr<object> p (db->load<object> ("1"));
+#endif
assert (p->s._tracking ());
t.commit ();
}
@@ -551,7 +555,11 @@ main (int argc, char* argv[])
// Armed copy.
//
{
+#ifdef HAVE_CXX11
+ unique_ptr<object> c;
+#else
auto_ptr<object> c;
+#endif
{
o.s.pop_back ();
@@ -616,7 +624,7 @@ main (int argc, char* argv[])
//
#ifdef HAVE_CXX11
{
- auto_ptr<object> c;
+ unique_ptr<object> c;
{
o.s.pop_back ();
@@ -692,8 +700,13 @@ main (int argc, char* argv[])
{
session s;
transaction t (db->begin ());
+#ifdef HAVE_CXX11
+ unique_ptr<inv_object1> p1 (db->load<inv_object1> (o1.id_));
+ unique_ptr<inv_object2> p2 (db->load<inv_object2> (o2.id_));
+#else
auto_ptr<inv_object1> p1 (db->load<inv_object1> (o1.id_));
auto_ptr<inv_object2> p2 (db->load<inv_object2> (o2.id_));
+#endif
assert (p2->o1[0] == p1.get ());
assert (!p2->o1._tracking ());
t.commit ();
diff --git a/common/container/change-tracking/test.hxx b/common/container/change-tracking/test.hxx
index bcb6880..0117316 100644
--- a/common/container/change-tracking/test.hxx
+++ b/common/container/change-tracking/test.hxx
@@ -18,7 +18,11 @@
#include <odb/core.hxx>
#include <odb/vector.hxx>
+#ifdef HAVE_CXX11
+#pragma db object pointer(std::unique_ptr)
+#else
#pragma db object pointer(std::auto_ptr)
+#endif
struct object
{
object () {}