aboutsummaryrefslogtreecommitdiff
path: root/odb/oracle/database.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-11-09 18:14:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-11-09 18:14:37 +0200
commit476f21938f75553d6bff5e8780b537f7182c5675 (patch)
tree27bc4afb2c6a8a673dee0eebeedcf4d7090b5437 /odb/oracle/database.ixx
parent56a8e716a30df1c894e6ccfa16c4a0bfb43baa9c (diff)
Make database class move-constructible
This means it can be returned by value from a function in C++11.
Diffstat (limited to 'odb/oracle/database.ixx')
-rw-r--r--odb/oracle/database.ixx22
1 files changed, 22 insertions, 0 deletions
diff --git a/odb/oracle/database.ixx b/odb/oracle/database.ixx
index 24f435a..167375d 100644
--- a/odb/oracle/database.ixx
+++ b/odb/oracle/database.ixx
@@ -2,12 +2,34 @@
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
// license : ODB NCUEL; see accompanying LICENSE file
+#include <utility> // move()
+
#include <odb/oracle/transaction.hxx>
namespace odb
{
namespace oracle
{
+#ifdef ODB_CXX11
+ inline database::
+ database (database&& db) // Has to be inline.
+ : odb::database (std::move (db)),
+ user_ (std::move (db.user_)),
+ password_ (std::move (db.password_)),
+ db_ (std::move (db.db_)),
+ service_ (std::move (db.service_)),
+ host_ (std::move (db.host_)),
+ port_ (db.port_),
+ charset_ (db.charset_),
+ ncharset_ (db.ncharset_),
+ auto_environment_ (std::move (db.auto_environment_)),
+ environment_ (db.environment_),
+ factory_ (std::move (db.factory_))
+ {
+ factory_->database (*this); // New database instance.
+ }
+#endif
+
inline connection_ptr database::
connection ()
{