summaryrefslogtreecommitdiff
path: root/src/value.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-05 04:24:15 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-05 04:24:15 -0500
commit15555d497f56e4b4d39e9a14f74b2c82cce52b90 (patch)
tree1e6c661379f02fdc52ef107fd500438ab69f3e60 /src/value.h
parent94b2518c4156e5a6b2be45bdbeeacf1ced0cd17f (diff)
parent060fc0e00bacb96d1d16163779d98c45c3999014 (diff)
downloadfork-ledger-15555d497f56e4b4d39e9a14f74b2c82cce52b90.tar.gz
fork-ledger-15555d497f56e4b4d39e9a14f74b2c82cce52b90.tar.bz2
fork-ledger-15555d497f56e4b4d39e9a14f74b2c82cce52b90.zip
Merge branch 'next'
Diffstat (limited to 'src/value.h')
-rw-r--r--src/value.h14
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;