From b5922fe3759de1d5a4941a8bdc5402350359425b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Oct 2010 18:21:39 +0200 Subject: Add support for persistent classes without default ctors New test: common/ctor. --- odb/result.txx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'odb/result.txx') 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 result_impl::pointer_type result_impl:: + 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; + } } -- cgit v1.1