diff src/Cell.cc @ 11037:e7864673c31f

new Cell (std::list<std::string>&) constructor
author John W. Eaton <jwe@octave.org>
date Tue, 28 Sep 2010 18:12:12 -0400
parents 64472dd48517
children fd0a3ac60b0e
line wrap: on
line diff
--- a/src/Cell.cc	Tue Sep 28 17:24:49 2010 -0400
+++ b/src/Cell.cc	Tue Sep 28 18:12:12 2010 -0400
@@ -63,6 +63,25 @@
     }
 }
 
+Cell::Cell (const std::list<std::string>& lst)
+  : Array<octave_value> ()
+{
+  size_t n = lst.size ();
+
+  if (n > 0)
+    {
+      resize (dim_vector (n, 1));
+
+      octave_idx_type i = 0;
+
+      for (std::list<std::string>::const_iterator it = lst.begin ();
+           it != lst.end (); it++)
+        {
+          elem(i++,0) = *it;
+        }
+    }
+}
+
 Cell::Cell (const Array<std::string>& sa)
   : Array<octave_value> (sa.dims ())
 {