diff options
Diffstat (limited to 'odb/lazy-ptr-impl.ixx')
-rw-r--r-- | odb/lazy-ptr-impl.ixx | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/odb/lazy-ptr-impl.ixx b/odb/lazy-ptr-impl.ixx index 8131897..769281b 100644 --- a/odb/lazy-ptr-impl.ixx +++ b/odb/lazy-ptr-impl.ixx @@ -38,25 +38,16 @@ namespace odb { r.id_ = 0; } +#endif - inline lazy_ptr_base& lazy_ptr_base:: - operator= (lazy_ptr_base&& r) + inline void lazy_ptr_base:: + reset_id () { - if (id_ != r.id_) - { - reset_id (); - id_ = r.id_; - db_ = r.db_; - loader_ = r.loader_; - free_ = r.free_; - copy_ = r.copy_; - - r.id_ = 0; - } + if (id_) + free_ (id_); - return *this; + id_ = 0; } -#endif inline void lazy_ptr_base:: reset_ (database_type* db, @@ -86,14 +77,25 @@ namespace odb loader_ = 0; } - inline void lazy_ptr_base:: - reset_id () +#ifdef ODB_CXX11 + inline lazy_ptr_base& lazy_ptr_base:: + operator= (lazy_ptr_base&& r) { - if (id_) - free_ (id_); + if (id_ != r.id_) + { + reset_id (); + id_ = r.id_; + db_ = r.db_; + loader_ = r.loader_; + free_ = r.free_; + copy_ = r.copy_; - id_ = 0; + r.id_ = 0; + } + + return *this; } +#endif inline lazy_ptr_base& lazy_ptr_base:: operator= (const lazy_ptr_base& r) |