diff options
-rw-r--r-- | odb/result.hxx | 19 | ||||
-rw-r--r-- | odb/result.txx | 21 |
2 files changed, 22 insertions, 18 deletions
diff --git a/odb/result.hxx b/odb/result.hxx index 9f7dcb0..ff9f057 100644 --- a/odb/result.hxx +++ b/odb/result.hxx @@ -41,21 +41,7 @@ namespace odb typedef typename traits::pointer_traits pointer_traits; pointer_type - current (bool release) - { - if (pointer_traits::null_ptr (current_) && !end_) - current (); - - pointer_type r (current_); - - if (release) - { - current_ = pointer_type (); - guard_.release (); - } - - return r; - } + current (bool release); bool end () const @@ -65,9 +51,6 @@ namespace odb protected: virtual void - current () = 0; - - virtual void current (T&) = 0; virtual void diff --git a/odb/result.txx b/odb/result.txx index 4b77c7e..e58af1f 100644 --- a/odb/result.txx +++ b/odb/result.txx @@ -10,4 +10,25 @@ namespace odb ~result_impl () { } + + template <typename T> + typename result_impl<T>::pointer_type result_impl<T>:: + current (bool release) + { + if (pointer_traits::null_ptr (current_) && !end_) + { + current (traits::create ()); + current (pointer_traits::get_ref (current_)); + } + + pointer_type r (current_); + + if (release) + { + current_ = pointer_type (); + guard_.release (); + } + + return r; + } } |