changeset 8470:5da39b223f61

base-list.h (push_front, pop_front, push_back, pop_back): new functions.
author John W. Eaton <jwe@octave.org>
date Mon, 12 Jan 2009 19:02:23 -0500
parents 830a03b5f165
children 02de6775f1fe
files src/ChangeLog src/base-list.h
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Jan 12 14:26:38 2009 -0500
+++ b/src/ChangeLog	Mon Jan 12 19:02:23 2009 -0500
@@ -1,5 +1,9 @@
 2009-01-12  John W. Eaton  <jwe@octave.org>
 
+	* base-list.h (octave_base_list::push_front,
+	octave_base_list::push_back, octave_base_list::pop_front,
+	octave_base_list::pop_back): New functions.
+
 	* DLD-FUNCTIONS/qr.cc (Fqrupdate, Fqrinsert, Fqrdelete, Fqrshift):
 	Require args to be numeric, not necessarily matrix objects.
 
--- a/src/base-list.h	Mon Jan 12 14:26:38 2009 -0500
+++ b/src/base-list.h	Mon Jan 12 19:02:23 2009 -0500
@@ -65,8 +65,6 @@
 
   void clear (void) { lst.clear (); }
 
-  void append (const elt_type& s) { lst.push_back (s); }
-
   iterator begin (void) { return iterator (lst.begin ()); }
   const_iterator begin (void) const { return const_iterator (lst.begin ()); }
 
@@ -79,6 +77,15 @@
   const elt_type& front (void) const { return lst.front (); }
   const elt_type& back (void) const { return lst.back (); }
 
+  void push_front (const elt_type& s) { lst.push_front (s); }
+  void push_back (const elt_type& s) { lst.push_back (s); }
+
+  void pop_front (void) { lst.pop_front (); }
+  void pop_back (void) { lst.pop_back (); }
+
+  // For backward compatibility.
+  void append (const elt_type& s) { lst.push_back (s); }
+
 private:
 
   std::list<elt_type> lst;