diff src/ov.cc @ 8551:906f976d35a8

further improve struct&cell indexing & indexed assignment
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 21 Jan 2009 13:02:49 +0100
parents b01fef323c24
children 20dfb885f877
line wrap: on
line diff
--- a/src/ov.cc	Wed Jan 21 07:07:12 2009 +0100
+++ b/src/ov.cc	Wed Jan 21 13:02:49 2009 +0100
@@ -1086,6 +1086,22 @@
     return *this;
 }
 
+octave_value
+octave_value::next_subsref (bool auto_add, const std::string& type,
+			    const std::list<octave_value_list>& idx,
+			    size_t skip) 
+{
+  if (! error_state && idx.size () > skip)
+    {
+      std::list<octave_value_list> new_idx (idx);
+      for (size_t i = 0; i < skip; i++)
+	new_idx.erase (new_idx.begin ());
+      return subsref (type.substr (skip), new_idx, auto_add);
+    }
+  else
+    return *this;
+}
+
 octave_value_list
 octave_value::do_multi_index_op (int nargout, const octave_value_list& idx)
 {