From d7318daf46ac3539f6f7651f99cc75921ffa4a37 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 6 Feb 2015 09:14:47 +0200 Subject: Add support for persisting std::deque --- common/container/basics/driver.cxx | 18 ++++++++++++++++++ common/container/basics/test.hxx | 8 ++++++++ 2 files changed, 26 insertions(+) (limited to 'common') diff --git a/common/container/basics/driver.cxx b/common/container/basics/driver.cxx index b880b56..cb3ae92 100644 --- a/common/container/basics/driver.cxx +++ b/common/container/basics/driver.cxx @@ -81,6 +81,11 @@ main (int argc, char* argv[]) med.sl.push_back ("aaa"); med.sl.push_back ("bbbb"); + // deque + // + med.nd.push_back (123); + med.nd.push_back (234); + // set // med.ns.insert (123); @@ -189,6 +194,12 @@ main (int argc, char* argv[]) full.sl.push_back ("bbbbb"); full.sl.push_back ("cccccc"); + // deque + // + full.nd.push_back (1234); + full.nd.push_back (2345); + full.nd.push_back (3456); + // set // full.ns.insert (1234); @@ -319,6 +330,7 @@ main (int argc, char* argv[]) empty.cv.push_back (comp (12, "aa")); empty.uv.push_back (12); empty.sl.push_back ("aa"); + empty.nd.push_back (12); empty.ns.insert (12); empty.ss.insert ("aa"); @@ -358,6 +370,8 @@ main (int argc, char* argv[]) med.sl.clear (); + med.nd.clear (); + med.ns.clear (); med.ss.clear (); med.cs.clear (); @@ -409,6 +423,10 @@ main (int argc, char* argv[]) full.sl.back () += "c"; full.sl.push_back ("ddddddd"); + // deque + // + full.nd.push_front (456); + // set // full.ns.insert (4567); diff --git a/common/container/basics/test.hxx b/common/container/basics/test.hxx index 517da0a..ca167ab 100644 --- a/common/container/basics/test.hxx +++ b/common/container/basics/test.hxx @@ -11,6 +11,7 @@ #include #include #include +#include #include #ifdef HAVE_CXX11 @@ -52,6 +53,7 @@ operator< (const comp& x, const comp& y) } typedef std::list str_list; +typedef std::deque num_deque; typedef std::vector num_vector; typedef std::vector str_vector; @@ -144,6 +146,10 @@ struct object #pragma db transient str_list& sl; + // deque + // + num_deque nd; + // set // num_set ns; @@ -234,6 +240,8 @@ operator== (const object& x, const object& y) x.sl == y.sl && + x.nd == y.nd && + x.ns == y.ns && x.ss == y.ss && x.cs == y.cs && -- cgit v1.1