aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-03-02 14:11:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-03-02 14:11:03 +0200
commit643e251d2d2ea49edc67254fb197489479b3586e (patch)
tree9cb5b18c658e59e7f0b7396cee0570ef3fbd0344
parent5f60d6859c6269b6a8fedbbf44973e8e9f28340c (diff)
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.
-rw-r--r--odb/oracle/database.cxx6
-rw-r--r--odb/oracle/database.hxx8
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 <iosfwd> // std::ostream
#include <odb/database.hxx>
-#include <odb/details/config.hxx> // ODB_CXX11
+#include <odb/details/unique-ptr.hxx>
#include <odb/details/transfer-ptr.hxx>
#include <odb/oracle/version.hxx>
@@ -188,11 +188,7 @@ namespace odb
auto_handle<OCIEnv> auto_environment_;
OCIEnv* environment_;
-#ifdef ODB_CXX11
- std::unique_ptr<connection_factory> factory_;
-#else
- std::auto_ptr<connection_factory> factory_;
-#endif
+ details::unique_ptr<connection_factory> factory_;
};
}
}