aboutsummaryrefslogtreecommitdiff
path: root/odb/mysql/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
commit34087db5762e86dcc60e596c70522303a623051c (patch)
tree76e7ad1c7356ba92fefd7c9ba424d31b035d37cd /odb/mysql/database.hxx
parentfcd2821109dd056b46494c3f71e5a015e2c08736 (diff)
Make database class move-constructible
This means it can be returned by value from a function in C++11.
Diffstat (limited to 'odb/mysql/database.hxx')
-rw-r--r--odb/mysql/database.hxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/odb/mysql/database.hxx b/odb/mysql/database.hxx
index 886167d..a0e3bd6 100644
--- a/odb/mysql/database.hxx
+++ b/odb/mysql/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>
@@ -116,6 +117,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&);
@@ -508,6 +515,8 @@ namespace odb
connection_ ();
private:
+ // Note: remember to update move ctor if adding any new members.
+ //
std::string user_;
std::string passwd_str_;
const char* passwd_;