aboutsummaryrefslogtreecommitdiff
path: root/common/const-object/test.hxx
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/const-object/test.hxx
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/const-object/test.hxx')
-rw-r--r--common/const-object/test.hxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/const-object/test.hxx b/common/const-object/test.hxx
index 93977f0..2e73d96 100644
--- a/common/const-object/test.hxx
+++ b/common/const-object/test.hxx
@@ -5,6 +5,8 @@
#ifndef TEST_HXX
#define TEST_HXX
+#include <common/config.hxx> // HAVE_CXX11
+
#include <memory>
#include <odb/core.hxx>
@@ -21,7 +23,11 @@ struct obj1
void cf () const {}
};
+#ifdef HAVE_CXX11
+#pragma db object pointer (std::unique_ptr<obj2>)
+#else
#pragma db object pointer (std::auto_ptr<obj2>)
+#endif
struct obj2
{
obj2 () {}
@@ -45,7 +51,12 @@ struct aggr
int id;
const obj1* o1;
+
+#ifdef HAVE_CXX11
+ std::unique_ptr<const obj2> o2;
+#else
std::auto_ptr<const obj2> o2;
+#endif
};
#endif // TEST_HXX