aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/mysql/database.cxx12
-rw-r--r--odb/mysql/database.hxx9
2 files changed, 8 insertions, 13 deletions
diff --git a/odb/mysql/database.cxx b/odb/mysql/database.cxx
index 03401d9..e7137bb 100644
--- a/odb/mysql/database.cxx
+++ b/odb/mysql/database.cxx
@@ -46,7 +46,7 @@ namespace odb
client_flags_ (client_flags),
factory_ (factory.transfer ())
{
- if (factory_.get () == 0)
+ if (!factory_)
factory_.reset (new connection_pool_factory ());
factory_->database (*this);
@@ -74,7 +74,7 @@ namespace odb
client_flags_ (client_flags),
factory_ (factory.transfer ())
{
- if (factory_.get () == 0)
+ if (!factory_)
factory_.reset (new connection_pool_factory ());
factory_->database (*this);
@@ -102,7 +102,7 @@ namespace odb
client_flags_ (client_flags),
factory_ (factory.transfer ())
{
- if (factory_.get () == 0)
+ if (!factory_)
factory_.reset (new connection_pool_factory ());
factory_->database (*this);
@@ -130,7 +130,7 @@ namespace odb
client_flags_ (client_flags),
factory_ (factory.transfer ())
{
- if (factory_.get () == 0)
+ if (!factory_)
factory_.reset (new connection_pool_factory ());
factory_->database (*this);
@@ -158,7 +158,7 @@ namespace odb
client_flags_ (client_flags),
factory_ (factory.transfer ())
{
- if (factory_.get () == 0)
+ if (!factory_)
factory_.reset (new connection_pool_factory ());
factory_->database (*this);
@@ -209,7 +209,7 @@ namespace odb
throw cli_exception (ostr.str ());
}
- if (factory_.get () == 0)
+ if (!factory_)
factory_.reset (new connection_pool_factory ());
factory_->database (*this);
diff --git a/odb/mysql/database.hxx b/odb/mysql/database.hxx
index 0f729eb..0008836 100644
--- a/odb/mysql/database.hxx
+++ b/odb/mysql/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/mysql/mysql.hxx>
@@ -213,12 +213,7 @@ namespace odb
const char* socket_;
std::string charset_;
unsigned long client_flags_;
-
-#ifdef ODB_CXX11
- std::unique_ptr<connection_factory> factory_;
-#else
- std::auto_ptr<connection_factory> factory_;
-#endif
+ details::unique_ptr<connection_factory> factory_;
};
}
}