aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/pgsql/database.cxx8
-rw-r--r--odb/pgsql/database.hxx9
2 files changed, 6 insertions, 11 deletions
diff --git a/odb/pgsql/database.cxx b/odb/pgsql/database.cxx
index 6a65780..4777f79 100644
--- a/odb/pgsql/database.cxx
+++ b/odb/pgsql/database.cxx
@@ -60,7 +60,7 @@ namespace odb
conninfo_ = ss.str ();
- if (factory_.get () == 0)
+ if (!factory_)
factory_.reset (new connection_pool_factory ());
factory_->database (*this);
@@ -108,7 +108,7 @@ namespace odb
conninfo_ = ss.str ();
- if (factory_.get () == 0)
+ if (!factory_)
factory_.reset (new connection_pool_factory ());
factory_->database (*this);
@@ -118,7 +118,7 @@ namespace odb
database (const string& conninfo, transfer_ptr<connection_factory> factory)
: port_ (0), conninfo_ (conninfo), factory_ (factory.transfer ())
{
- if (factory_.get () == 0)
+ if (!factory_)
factory_.reset (new connection_pool_factory ());
factory_->database (*this);
@@ -191,7 +191,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/pgsql/database.hxx b/odb/pgsql/database.hxx
index c3b42f2..c8789ac 100644
--- a/odb/pgsql/database.hxx
+++ b/odb/pgsql/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/pgsql/version.hxx>
@@ -175,12 +175,7 @@ namespace odb
std::string socket_ext_;
std::string extra_conninfo_;
std::string conninfo_;
-
-#ifdef ODB_CXX11
- std::unique_ptr<connection_factory> factory_;
-#else
- std::auto_ptr<connection_factory> factory_;
-#endif
+ details::unique_ptr<connection_factory> factory_;
};
}
}