diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-05-11 06:52:02 -0400 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-05-11 06:52:02 -0400 |
commit | 38b4810e67bf461ddad1cdd75b491ba7f8d5dd9b (patch) | |
tree | 8b92f2f141bf822418123d2e8dceac9a17e0e4a8 | |
parent | 429cd8f13191cc08f6461d646fdde2d573496f06 (diff) |
Make move constructor inline
C++11 support has to be inline or template.
-rw-r--r-- | odb/vector-impl.cxx | 24 | ||||
-rw-r--r-- | odb/vector-impl.ixx | 15 |
2 files changed, 16 insertions, 23 deletions
diff --git a/odb/vector-impl.cxx b/odb/vector-impl.cxx index 08019d6..402f5cf 100644 --- a/odb/vector-impl.cxx +++ b/odb/vector-impl.cxx @@ -4,15 +4,8 @@ #include <odb/vector-impl.hxx> -#include <cstring> // std::memcpy, std::memset - -#ifdef ODB_CXX11 -# include <utility> // std::swap, std::move -#else -# include <algorithm> // std::swap -#endif - -#include <iostream> // @@ tmp +#include <cstring> // std::memcpy, std::memset +#include <algorithm> // std::swap using namespace std; @@ -184,19 +177,6 @@ namespace odb // vector_base // -#ifdef ODB_CXX11 - vector_base:: - vector_base (vector_base&& x) - : impl_ (std::move (x.impl_)), tran_ (0) - { - if (x.tran_ != 0) - { - x.tran_->callback_unregister (&x); - _arm (*x.tran_); - } - } -#endif - void vector_base:: rollback (unsigned short, void* key, unsigned long long) { diff --git a/odb/vector-impl.ixx b/odb/vector-impl.ixx index 41360b8..9fdadfb 100644 --- a/odb/vector-impl.ixx +++ b/odb/vector-impl.ixx @@ -3,7 +3,7 @@ // license : GNU GPL v2; see accompanying LICENSE file #ifdef ODB_CXX11 -# include <utility> // std::swap +# include <utility> // std::swap, std::move #else # include <algorithm> // std::swap #endif @@ -137,6 +137,19 @@ namespace odb // vector_base // +#ifdef ODB_CXX11 + inline vector_base:: + vector_base (vector_base&& x) + : impl_ (std::move (x.impl_)), tran_ (0) + { + if (x.tran_ != 0) + { + x.tran_->callback_unregister (&x); + _arm (*x.tran_); + } + } +#endif + inline void vector_base:: _arm (transaction& t) const { |