diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-09 18:14:37 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-11-09 18:14:37 +0200 |
commit | 0bf77eaad1fb2ad23f9aec64ea0fe3ab7cf06a28 (patch) | |
tree | 49d0ff8ee2f193c9eabfc67b06f1a2134d21a8b3 /odb/mssql/auto-handle.hxx | |
parent | ea61e19c6c0a52be4740448d0d21605e090b460d (diff) |
Make database class move-constructible
This means it can be returned by value from a function in C++11.
Diffstat (limited to 'odb/mssql/auto-handle.hxx')
-rw-r--r-- | odb/mssql/auto-handle.hxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/odb/mssql/auto-handle.hxx b/odb/mssql/auto-handle.hxx index 81f9246..e54e543 100644 --- a/odb/mssql/auto-handle.hxx +++ b/odb/mssql/auto-handle.hxx @@ -7,6 +7,8 @@ #include <odb/pre.hxx> +#include <odb/details/config.hxx> // ODB_CXX11 + #include <odb/mssql/mssql-fwd.hxx> #include <odb/mssql/version.hxx> @@ -62,6 +64,16 @@ namespace odb h_ = h; } +#ifdef ODB_CXX11 + auto_handle (auto_handle&& ah): h_ (ah.release ()) {} + auto_handle& operator= (auto_handle&& ah) + { + if (this != &ah) + reset (ah.release ()); + return *this; + } +#endif + private: auto_handle (const auto_handle&); auto_handle& operator= (const auto_handle&); |