aboutsummaryrefslogtreecommitdiff
path: root/odb/pgsql/database.hxx
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
commitfc70be62d8698496a20b6947d102757f426c5b3e (patch)
tree92610ee68abf5a1fcc40e8717c4011628865c601 /odb/pgsql/database.hxx
parentf5f515acc2b926eb838b82b457f6b5979db5f309 (diff)
Make database class move-constructible
This means it can be returned by value from a function in C++11.
Diffstat (limited to 'odb/pgsql/database.hxx')
-rw-r--r--odb/pgsql/database.hxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/odb/pgsql/database.hxx b/odb/pgsql/database.hxx
index 6ad1ba9..bf77397 100644
--- a/odb/pgsql/database.hxx
+++ b/odb/pgsql/database.hxx
@@ -12,6 +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>
@@ -78,6 +79,12 @@ namespace odb
details::transfer_ptr<connection_factory> =
details::transfer_ptr<connection_factory> ());
+ // Move-constructible but not move-assignable.
+ //
+#ifdef ODB_CXX11
+ database (database&&);
+#endif
+
static void
print_usage (std::ostream&);
@@ -470,6 +477,8 @@ namespace odb
}
private:
+ // Note: remember to update move ctor if adding any new members.
+ //
std::string user_;
std::string password_;
std::string db_;