diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-02-29 10:57:43 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-02-29 10:57:43 +0200 |
commit | d706ea36e08230eb21996562e4e129495d871239 (patch) | |
tree | 9c88dfd111027a40dcd61ce01f4cd64c4f32b309 /common/relationship/driver.cxx | |
parent | 439bc0ff201f38025d224ce421c86ca44f3dc063 (diff) |
Support for C++11 std::unique_ptr as object pointer
This includes the odb::lazy_unique_ptr implementation.
Diffstat (limited to 'common/relationship/driver.cxx')
-rw-r--r-- | common/relationship/driver.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/common/relationship/driver.cxx b/common/relationship/driver.cxx index 20e0f0c..c6f4b01 100644 --- a/common/relationship/driver.cxx +++ b/common/relationship/driver.cxx @@ -30,6 +30,13 @@ main (int argc, char* argv[]) aggr a ("aggr"); a.o1 = new obj1 ("o1", "obj1"); a.o2.reset (new obj2 ("obj2")); + +#ifdef HAVE_CXX11 + a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 1"))); + a.v2.push_back (0); + a.v2.push_back (obj2_ptr (new obj2 ("v1 obj2 2"))); +#endif + #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) a.o3.reset (new obj3 ("obj3")); @@ -60,6 +67,13 @@ main (int argc, char* argv[]) transaction t (db->begin ()); db->persist (a.o1); db->persist (a.o2); + +#ifdef HAVE_CXX11 + for (obj2_vec::iterator i (a.v2.begin ()); i != a.v2.end (); ++i) + if (*i) + db->persist (*i); +#endif + #if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY) db->persist (a.o3); |