diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-06-15 18:50:51 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-06-15 18:50:51 +0200 |
commit | 72f9ee644d3a048e68ba9570a096b6dd12c5ee1a (patch) | |
tree | 5670eaa8c20845b401c0b09bd0d643b971c675d9 /common/bulk | |
parent | 766b7533addb5c981b135640321c291be270d907 (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/bulk')
-rw-r--r-- | common/bulk/driver.cxx | 28 | ||||
-rw-r--r-- | common/bulk/test.hxx | 26 |
2 files changed, 27 insertions, 27 deletions
diff --git a/common/bulk/driver.cxx b/common/bulk/driver.cxx index 06bd06c..d6a294a 100644 --- a/common/bulk/driver.cxx +++ b/common/bulk/driver.cxx @@ -327,13 +327,6 @@ main (int argc, char* argv[]) test (db, v.begin (), v.end ()); } - { - auto_ptr<auto_object> a[2]; - a[0].reset (new auto_object (1, "a")); - a[1].reset (new auto_object (2, "b")); - test (db, a, a + sizeof (a) / sizeof (a[0])); - } - #ifdef HAVE_CXX11 { vector<unique_ptr<unique_object>> v; @@ -341,6 +334,13 @@ main (int argc, char* argv[]) v.push_back (unique_ptr<unique_object> (new unique_object (2, "b"))); test (db, v.begin (), v.end ()); } +#else + { + auto_ptr<auto_object> a[2]; + a[0].reset (new auto_object (1, "a")); + a[1].reset (new auto_object (2, "b")); + test (db, a, a + sizeof (a) / sizeof (a[0])); + } #endif { @@ -981,13 +981,6 @@ main (int argc, char* argv[]) test (db, v.begin (), v.end ()); } - { - auto_ptr<auto_object> a[2]; - a[0].reset (new auto_object (1, "a")); - a[1].reset (new auto_object (2, "b")); - test (db, a, a + sizeof (a) / sizeof (a[0])); - } - #ifdef HAVE_CXX11 { vector<unique_ptr<unique_object>> v; @@ -995,6 +988,13 @@ main (int argc, char* argv[]) v.push_back (unique_ptr<unique_object> (new unique_object (2, "b"))); test (db, v.begin (), v.end ()); } +#else + { + auto_ptr<auto_object> a[2]; + a[0].reset (new auto_object (1, "a")); + a[1].reset (new auto_object (2, "b")); + test (db, a, a + sizeof (a) / sizeof (a[0])); + } #endif { diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx index 85cb5c3..ce55158 100644 --- a/common/bulk/test.hxx +++ b/common/bulk/test.hxx @@ -32,10 +32,11 @@ namespace test1 std::string s; }; - #pragma db object bulk(3) pointer(std::auto_ptr) - struct auto_object +#ifdef HAVE_CXX11 + #pragma db object bulk(3) pointer(std::unique_ptr) + struct unique_object { - auto_object (unsigned int n_ = 0, std::string s_ = "") + unique_object (unsigned int n_ = 0, std::string s_ = "") : id (0), n (n_), s (s_) {} #pragma db id auto @@ -44,12 +45,11 @@ namespace test1 unsigned int n; std::string s; }; - -#ifdef HAVE_CXX11 - #pragma db object bulk(3) pointer(std::unique_ptr) - struct unique_object +#else + #pragma db object bulk(3) pointer(std::auto_ptr) + struct auto_object { - unique_object (unsigned int n_ = 0, std::string s_ = "") + auto_object (unsigned int n_ = 0, std::string s_ = "") : id (0), n (n_), s (s_) {} #pragma db id auto @@ -176,16 +176,16 @@ namespace test6 #pragma db object(object) bulk(3) #pragma db member(object::id) id auto - typedef object_template<2> auto_object; - - #pragma db object(auto_object) bulk(3) pointer(std::auto_ptr) - #pragma db member(auto_object::id) id auto - #ifdef HAVE_CXX11 typedef object_template<3> unique_object; #pragma db object(unique_object) bulk(3) pointer(std::unique_ptr) #pragma db member(unique_object::id) id auto +#else + typedef object_template<2> auto_object; + + #pragma db object(auto_object) bulk(3) pointer(std::auto_ptr) + #pragma db member(auto_object::id) id auto #endif } |