aboutsummaryrefslogtreecommitdiff
path: root/common/wrapper/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-02-29 11:53:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-02-29 11:53:22 +0200
commit528f932066ecfc6a9fb5477031114da5aeceeb9c (patch)
treeaf00256e2c65e40b6b125d0f1bf9d1a6c3a57c5c /common/wrapper/driver.cxx
parentd706ea36e08230eb21996562e4e129495d871239 (diff)
Support for C++11 std::unique_ptr and std::shared_ptr as wrappers
Diffstat (limited to 'common/wrapper/driver.cxx')
-rw-r--r--common/wrapper/driver.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/common/wrapper/driver.cxx b/common/wrapper/driver.cxx
index bb48fde..4f78a1b 100644
--- a/common/wrapper/driver.cxx
+++ b/common/wrapper/driver.cxx
@@ -36,9 +36,9 @@ main (int argc, char* argv[])
o.num.reset (new int (123));
o.nstrs.push_back (nullable_string ());
o.nstrs.push_back (nullable_string ("123"));
-#ifdef HAVE_TR1_MEMORY
- o.tr1_strs.push_back (tr1_nullable_string ());
- o.tr1_strs.push_back (tr1_nullable_string (new string ("123")));
+#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY)
+ o.sstrs.push_back (str_sptr ());
+ o.sstrs.push_back (str_sptr (new string ("123")));
#endif
transaction t (db->begin ());
@@ -56,10 +56,10 @@ main (int argc, char* argv[])
assert (o->nstr.null ());
assert (o->nstrs[0].null ());
assert (o->nstrs[1].get () == "123");
-#ifdef HAVE_TR1_MEMORY
- assert (!o->tr1_str);
- assert (!o->tr1_strs[0]);
- assert (*o->tr1_strs[1] == "123");
+#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY)
+ assert (!o->sstr);
+ assert (!o->sstrs[0]);
+ assert (*o->sstrs[1] == "123");
#endif
}
@@ -102,10 +102,10 @@ main (int argc, char* argv[])
{
cont_object co;
- co.vi.reset (new vector<int>);
- co.vi->push_back (1);
- co.vi->push_back (2);
- co.vi->push_back (3);
+ co.nums.reset (new vector<int>);
+ co.nums->push_back (1);
+ co.nums->push_back (2);
+ co.nums->push_back (3);
co.c.num = 123;
co.c.strs.reset (new vector<string>);
@@ -124,7 +124,7 @@ main (int argc, char* argv[])
auto_ptr<cont_object> o (db->load<cont_object> (id));
t.commit ();
- assert (*o->vi == *co.vi);
+ assert (*o->nums == *co.nums);
assert (o->c == co.c);
}
}