aboutsummaryrefslogtreecommitdiff
path: root/common/bulk/test.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/bulk/test.hxx')
-rw-r--r--common/bulk/test.hxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/common/bulk/test.hxx b/common/bulk/test.hxx
index 8497174..526762f 100644
--- a/common/bulk/test.hxx
+++ b/common/bulk/test.hxx
@@ -155,4 +155,38 @@ namespace test5
};
}
+// Test API with persistent class template instantiations.
+//
+#pragma db namespace table("t6_")
+namespace test6
+{
+ template <int>
+ struct object_template
+ {
+ object_template (unsigned int n_ = 0, std::string s_ = "")
+ : id (0), n (n_), s (s_) {}
+
+ unsigned long id;
+ unsigned int n;
+ std::string s;
+ };
+
+ typedef object_template<1> object;
+
+ #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
+#endif
+}
+
#endif // TEST_HXX