aboutsummaryrefslogtreecommitdiff
path: root/hello/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-09-20 18:00:14 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-09-20 18:00:14 +0200
commitc542a0841869618f82188bc193e21a6a6972f0ba (patch)
tree81bb3bc077e8688bf7efec18d248b6c4c325ff5c /hello/driver.cxx
parent0964f353f05cbc6040e233fe955931aaefc66200 (diff)
Make result_iterator::operator* return reference
Add load() version that returns the dynamically-allocated instance.
Diffstat (limited to 'hello/driver.cxx')
-rw-r--r--hello/driver.cxx5
1 files changed, 3 insertions, 2 deletions
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<person> joe (*i);
+ auto_ptr<person> 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.
//
{