From c542a0841869618f82188bc193e21a6a6972f0ba Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 20 Sep 2010 18:00:14 +0200 Subject: Make result_iterator::operator* return reference Add load() version that returns the dynamically-allocated instance. --- hello/driver.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hello') diff --git a/hello/driver.cxx b/hello/driver.cxx index 348efdb..e7bc114 100644 --- a/hello/driver.cxx +++ b/hello/driver.cxx @@ -77,9 +77,9 @@ main (int argc, char* argv[]) t.commit (); } - /* // Alternative implementation without using the id. // + /* { transaction t (db->begin_transaction ()); @@ -90,7 +90,7 @@ main (int argc, char* argv[]) if (i != r.end ()) { - auto_ptr joe (*i); + auto_ptr joe (i.load ()); joe->age (joe->age () + 1); db->update (*joe); } @@ -99,6 +99,7 @@ main (int argc, char* argv[]) } */ + // John Doe is no longer in our database. // { -- cgit v1.1