summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/sqldbm.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-08-28 01:37:07 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-08-28 01:37:07 +0200
commit02ef691263a4ca800b01530e73f4d2ddd9cce23b (patch)
treee051a95a1aaedbba92e52fe34ded31e4bd1ed206 /crawl-ref/source/sqldbm.cc
parent5bb725201a068fa211b165a8b6c1e1694d335d7e (diff)
downloadcrawl-ref-02ef691263a4ca800b01530e73f4d2ddd9cce23b.tar.gz
crawl-ref-02ef691263a4ca800b01530e73f4d2ddd9cce23b.zip
Use unique_ptr instead of auto_ptr (emulated for non-C++11).
This stops the tons of warnings, while allowing building for both old and new C++ standards. And if we wanted to use shared_ptr or something, now we can without being ambiguous.
Diffstat (limited to 'crawl-ref/source/sqldbm.cc')
-rw-r--r--crawl-ref/source/sqldbm.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/crawl-ref/source/sqldbm.cc b/crawl-ref/source/sqldbm.cc
index d70bd27a34..03999a0e8a 100644
--- a/crawl-ref/source/sqldbm.cc
+++ b/crawl-ref/source/sqldbm.cc
@@ -253,20 +253,20 @@ string SQL_DBM::query(const string &key)
return result;
}
-auto_ptr<string> SQL_DBM::firstkey()
+unique_ptr<string> SQL_DBM::firstkey()
{
if (init_iterator() != SQLITE_OK)
{
- auto_ptr<string> result;
+ unique_ptr<string> result;
return result;
}
return nextkey();
}
-auto_ptr<string> SQL_DBM::nextkey()
+unique_ptr<string> SQL_DBM::nextkey()
{
- auto_ptr<string> result;
+ unique_ptr<string> result;
if (s_iterator)
{
if (ec(sqlite3_step(s_iterator)) == SQLITE_ROW)
@@ -412,9 +412,9 @@ sql_datum dbm_fetch(SQL_DBM *db, const sql_datum &key)
return sql_datum(ans);
}
-static sql_datum dbm_key(SQL_DBM *db, auto_ptr<string> (SQL_DBM::*key)())
+static sql_datum dbm_key(SQL_DBM *db, unique_ptr<string> (SQL_DBM::*key)())
{
- auto_ptr<string> res = (db->*key)();
+ unique_ptr<string> res = (db->*key)();
if (res.get())
return sql_datum(*res.get());
else