From fc3fb39c90ab7fe5fccbe3f3bc0eb2645157bb96 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 13 Dec 2023 21:57:53 +0300 Subject: Switch to build2 --- common/const-object/driver.cxx | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'common/const-object/driver.cxx') diff --git a/common/const-object/driver.cxx b/common/const-object/driver.cxx index 90efb4e..7ef48ee 100644 --- a/common/const-object/driver.cxx +++ b/common/const-object/driver.cxx @@ -4,19 +4,21 @@ // Test database operations with const objects. // -#include // std::auto_ptr -#include +#include // std::unique_ptr #include #include #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" +#undef NDEBUG +#include + using namespace std; using namespace odb::core; @@ -25,7 +27,7 @@ main (int argc, char* argv[]) { try { - auto_ptr db (create_database (argc, argv)); + unique_ptr db (create_database (argc, argv)); aggr a (1); aggr ca_ (2); // o1 and o2 are NULL @@ -36,18 +38,10 @@ main (int argc, char* argv[]) const obj1* co1 (co1_); a.o1 = co1; -#ifdef HAVE_CXX11 unique_ptr o2 (new obj2 (1)); -#else - auto_ptr o2 (new obj2 (1)); -#endif obj2* co2_ (new obj2 (2)); a.o2.reset (co2_); -#ifdef HAVE_CXX11 unique_ptr& co2 (a.o2); -#else - auto_ptr& co2 (a.o2); -#endif // persist via references // @@ -83,13 +77,8 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); -#ifdef HAVE_CXX11 unique_ptr a (db->load (1)); unique_ptr ca (db->load (2)); -#else - auto_ptr a (db->load (1)); - auto_ptr ca (db->load (2)); -#endif t.commit (); @@ -160,13 +149,8 @@ main (int argc, char* argv[]) { // i->f (); // error i->cf (); -#ifdef HAVE_CXX11 //unique_ptr p (i.load ()); // error unique_ptr p (i.load ()); -#else - // auto_ptr p (i.load ()); // error - auto_ptr p (i.load ()); -#endif obj2 o (0); i.load (o); assert (p->id == o.id); -- cgit v1.1