From 89ceaaf470d19d475d665b87a1fbe66009d0912b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Mar 2012 12:34:41 +0200 Subject: Add support for using C++11 std::unique_ptr to pass connection factory --- odb/sqlite/database.hxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'odb/sqlite/database.hxx') diff --git a/odb/sqlite/database.hxx b/odb/sqlite/database.hxx index ba0e2c2..d2bf61f 100644 --- a/odb/sqlite/database.hxx +++ b/odb/sqlite/database.hxx @@ -10,10 +10,12 @@ #include #include -#include // std::auto_ptr +#include // std::auto_ptr, std::unique_ptr #include // std::ostream #include +#include // ODB_CXX11 +#include #include #include @@ -36,8 +38,8 @@ namespace odb database (const std::string& name, int flags = SQLITE_OPEN_READWRITE, bool foreign_keys = true, - std::auto_ptr = - std::auto_ptr (0)); + details::transfer_ptr = + details::transfer_ptr ()); // Extract the database parameters from the command line. The // following options are recognized: @@ -58,8 +60,8 @@ namespace odb bool erase = false, int flags = SQLITE_OPEN_READWRITE, bool foreign_keys = true, - std::auto_ptr = - std::auto_ptr (0)); + details::transfer_ptr = + details::transfer_ptr ()); static void print_usage (std::ostream&); @@ -131,7 +133,12 @@ namespace odb std::string name_; int flags_; bool foreign_keys_; + +#ifdef ODB_CXX11 + std::unique_ptr factory_; +#else std::auto_ptr factory_; +#endif }; } } -- cgit v1.1