From 643e251d2d2ea49edc67254fb197489479b3586e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 2 Mar 2012 14:11:03 +0200 Subject: Reimplement C++11 support to be header-only This way, the same build of the runtime libraries can be used in both C++98 and C++11 modes. This is important for when runtimes are installed or packaged. --- odb/oracle/database.cxx | 6 +++--- odb/oracle/database.hxx | 8 ++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/odb/oracle/database.cxx b/odb/oracle/database.cxx index a8abb53..dd35305 100644 --- a/odb/oracle/database.cxx +++ b/odb/oracle/database.cxx @@ -51,7 +51,7 @@ namespace odb auto_environment_.reset (environment_); } - if (factory_.get () == 0) + if (!factory_) factory_.reset (new connection_pool_factory ()); factory_->database (*this); @@ -111,7 +111,7 @@ namespace odb db_ = ss.str (); - if (factory_.get () == 0) + if (!factory_) factory_.reset (new connection_pool_factory ()); factory_->database (*this); @@ -210,7 +210,7 @@ namespace odb throw cli_exception (oss.str ()); } - if (factory_.get () == 0) + if (!factory_) factory_.reset (new connection_pool_factory ()); factory_->database (*this); diff --git a/odb/oracle/database.hxx b/odb/oracle/database.hxx index d51d073..65d29c6 100644 --- a/odb/oracle/database.hxx +++ b/odb/oracle/database.hxx @@ -12,7 +12,7 @@ #include // std::ostream #include -#include // ODB_CXX11 +#include #include #include @@ -188,11 +188,7 @@ namespace odb auto_handle auto_environment_; OCIEnv* environment_; -#ifdef ODB_CXX11 - std::unique_ptr factory_; -#else - std::auto_ptr factory_; -#endif + details::unique_ptr factory_; }; } } -- cgit v1.1