diff options
Diffstat (limited to 'src/value.h')
-rw-r--r-- | src/value.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/value.h b/src/value.h index 2ce90fa2..0993305e 100644 --- a/src/value.h +++ b/src/value.h @@ -87,7 +87,7 @@ public: * The sequence_t member type abstracts the type used to represent a * resizable "array" of value_t objects. */ - typedef std::vector<value_t> sequence_t; + typedef std::deque<value_t> sequence_t; typedef sequence_t::iterator iterator; typedef sequence_t::const_iterator const_iterator; typedef sequence_t::difference_type difference_type; @@ -234,7 +234,7 @@ private: friend class boost::serialization::access; template<class Archive> - void serialize(Archive & ar, const unsigned int /* version */) { + void serialize(Archive& ar, const unsigned int /* version */) { ar & data; ar & type; ar & refc; @@ -800,6 +800,14 @@ public: return null; } + void push_front(const value_t& val) { + if (is_null()) + *this = sequence_t(); + if (! is_sequence()) + in_place_cast(SEQUENCE); + as_sequence_lval().push_front(val); + } + void push_back(const value_t& val) { if (is_null()) *this = sequence_t(); @@ -917,7 +925,7 @@ private: friend class boost::serialization::access; template<class Archive> - void serialize(Archive & ar, const unsigned int /* version */) { + void serialize(Archive& ar, const unsigned int /* version */) { ar & true_value; ar & false_value; ar & storage; |