diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-11 16:15:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-11 16:15:26 +0200 |
commit | b2f552f3505c1d8247e1a0ca844fe372ef639f79 (patch) | |
tree | 2e46697657144f9b965ffddc04ceba0750294164 /odb/lazy-ptr-impl.ixx | |
parent | c6bc6ecf14ba7b43350a65df9701b0848c95d0e2 (diff) |
Rearrange inline function order to help MinGW2.4.0
On MinGW, if a DLL-exported inline function is called before it is
known to be inline, the compiler issues a warning.
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) |