From 476f21938f75553d6bff5e8780b537f7182c5675 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 9 Nov 2015 18:14:37 +0200 Subject: Make database class move-constructible This means it can be returned by value from a function in C++11. --- odb/oracle/database.ixx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'odb/oracle/database.ixx') 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 // move() + #include 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 () { -- cgit v1.1