aboutsummaryrefslogtreecommitdiff
path: root/common/prepared/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-06-15 18:50:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-06-15 18:50:51 +0200
commit72f9ee644d3a048e68ba9570a096b6dd12c5ee1a (patch)
tree5670eaa8c20845b401c0b09bd0d643b971c675d9 /common/prepared/driver.cxx
parent766b7533addb5c981b135640321c291be270d907 (diff)
Get rid of C++11 deprecation warnings for auto_ptr, exception specs
In particular, std::auto_ptr is no longer mapped in C++11.
Diffstat (limited to 'common/prepared/driver.cxx')
-rw-r--r--common/prepared/driver.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/common/prepared/driver.cxx b/common/prepared/driver.cxx
index 0d30821..0467f70 100644
--- a/common/prepared/driver.cxx
+++ b/common/prepared/driver.cxx
@@ -33,13 +33,21 @@ query_factory (const char* name, connection& c)
{
typedef odb::query<person> query;
+#ifdef HAVE_CXX11
+ unique_ptr<params> p (new params);
+#else
auto_ptr<params> p (new params);
+#endif
prepared_query<person> pq (
c.prepare_query<person> (
name,
query::age > query::_ref (p->age) &&
query::name != query::_ref (p->name)));
+#ifdef HAVE_CXX11
+ c.cache_query (pq, move (p));
+#else
c.cache_query (pq, p);
+#endif
}
int
@@ -286,13 +294,13 @@ main (int argc, char* argv[])
{
typedef odb::query<person> query;
- auto_ptr<params> p (new params);
+ unique_ptr<params> p (new params);
prepared_query<person> pq (
c.prepare_query<person> (
name,
query::age > query::_ref (p->age) &&
query::name != query::_ref (p->name)));
- c.cache_query (pq, p);
+ c.cache_query (pq, move (p));
});
for (unsigned int i (1); i < 6; ++i)