diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-10-07 18:21:39 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-10-07 18:21:39 +0200 |
commit | b5922fe3759de1d5a4941a8bdc5402350359425b (patch) | |
tree | e4dfea9499ec46d5f2d4ec01fde1bf6505379c8f /odb/result.txx | |
parent | 9486224f3d675d5498bbfee7fe4e10b01204b635 (diff) |
Add support for persistent classes without default ctors
New test: common/ctor.
Diffstat (limited to 'odb/result.txx')
-rw-r--r-- | odb/result.txx | 21 |
1 files changed, 21 insertions, 0 deletions
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; + } } |