diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-09-20 18:00:14 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-09-20 18:00:14 +0200 |
commit | e291e5d0661c7980a969a243f8a6512d1b9cf5df (patch) | |
tree | 9c4f329bdd9872a475d13a8170a5e57f0cb237a5 /common | |
parent | 27f66487bc50ee5086c22f5831d72e4669fba084 (diff) |
Make result_iterator::operator* return reference
Add load() version that returns the dynamically-allocated instance.
Diffstat (limited to 'common')
-rw-r--r-- | common/query/driver.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/query/driver.cxx b/common/query/driver.cxx index eede6d8..7e64ca3 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -26,7 +26,7 @@ print (result<person>& r) { for (result<person>::iterator i (r.begin ()); i != r.end (); ++i) { - auto_ptr<person> o (*i); + auto_ptr<person> o (i.load ()); cout << *o << endl; } cout << endl; @@ -112,7 +112,9 @@ main (int argc, char* argv[]) for (result::iterator i (r.begin ()); i != r.end (); ++i) { - cout << i->first_name_; + person& p (*i); + + cout << p.first_name_; if (i->middle_name_.get () != 0) cout << ' ' << *i->middle_name_; |