Mercurial > hg > octave-lojdl
changeset 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 | 169f59f626d3 |
children | 35416c9baf76 |
files | src/Cell.cc src/Cell.h src/ChangeLog |
diffstat | 3 files changed, 26 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Cell.cc +++ b/src/Cell.cc @@ -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 ()) {