aboutsummaryrefslogtreecommitdiff
path: root/common/relationship/test.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-02-28 12:46:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-02-28 12:46:48 +0200
commit439bc0ff201f38025d224ce421c86ca44f3dc063 (patch)
tree71d9f025b3ee1dc1a49f83584c2e21a88cc048cd /common/relationship/test.hxx
parent564700ab7c96b671b0c08a37e9a0e50f4b2fc176 (diff)
Test std::shared_ptr in C++11 mode and std::tr1::shared_ptr in C++98 mode
Diffstat (limited to 'common/relationship/test.hxx')
-rw-r--r--common/relationship/test.hxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx
index bd18747..8b40dba 100644
--- a/common/relationship/test.hxx
+++ b/common/relationship/test.hxx
@@ -5,7 +5,7 @@
#ifndef TEST_HXX
#define TEST_HXX
-#include <common/config.hxx> // HAVE_TR1_MEMORY
+#include <common/config.hxx> // HAVE_CXX11, HAVE_TR1_MEMORY
#include <set>
#include <map>
@@ -15,7 +15,7 @@
#include <odb/core.hxx>
-#ifdef HAVE_TR1_MEMORY
+#if !defined(HAVE_CXX11) && defined(HAVE_TR1_MEMORY)
# include <odb/tr1/memory.hxx>
#endif
@@ -138,11 +138,16 @@ operator== (const obj2& x, const obj2& y)
return x.id == y.id && x.str == y.str;
}
-// tr1::shared_ptr
+// shared_ptr
//
-#ifdef HAVE_TR1_MEMORY
+#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY)
struct obj3;
+
+#ifdef HAVE_CXX11
+typedef std::shared_ptr<obj3> obj3_ptr;
+#else
typedef std::tr1::shared_ptr<obj3> obj3_ptr;
+#endif
#pragma db object pointer(obj3_ptr)
struct obj3
@@ -211,7 +216,7 @@ struct aggr
obj1* o1;
std::auto_ptr<obj2> o2;
-#ifdef HAVE_TR1_MEMORY
+#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY)
obj3_ptr o3;
comp c;
comp_vec cv;
@@ -235,7 +240,7 @@ operator== (const aggr& x, const aggr& y)
x.id == y.id &&
(x.o1 ? (y.o1 && *x.o1 == *y.o1) : !y.o1) &&
(x.o2.get () ? (y.o2.get () && *x.o2 == *y.o2) : !y.o2.get ()) &&
-#ifdef HAVE_TR1_MEMORY
+#if defined(HAVE_CXX11) || defined(HAVE_TR1_MEMORY)
(x.o3.get () ? (y.o3.get () && *x.o3 == *y.o3) : !y.o3.get ()) &&
x.c == y.c &&
x.cv == y.cv &&