changeset 9545:8670e55078fd

allow constructing octave_value_list from size
author Jaroslav Hajek <highegg@gmail.com>
date Mon, 17 Aug 2009 14:46:18 +0200
parents df0abc63c230
children 1beb23d2b892
files src/ChangeLog src/oct-obj.h
diffstat 2 files changed, 8 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-17  Jaroslav Hajek  <highegg@gmail.com>
+
+	* oct-obj.h (octave_value_list::octave_value_list (octave_idx_type)):
+	Allow this constructor.
+
 2009-08-19  Jaroslav Hajek  <highegg@gmail.com>
 
 	* DLD-FUNCTIONS/find.cc (Ffind): Reuse cached index vector when
--- a/src/oct-obj.h
+++ b/src/oct-obj.h
@@ -44,6 +44,9 @@
   octave_value_list (void)
     : data () { }
 
+  explicit octave_value_list (octave_idx_type n)
+    : data (dim_vector (1, n)) { }
+
   octave_value_list (octave_idx_type n, const octave_value& val)
     : data (dim_vector (1, n), val) { }
 
@@ -154,22 +157,6 @@
   // a name.  By default, it is empty.
   string_vector names;
 
-  // This constructor is private with no definition to keep statements
-  // like
-  //
-  //   octave_value_list foo = 5;
-  //   octave_value_list foo = 5.0;
-  //
-  // from doing different things.  Instead, you have to use the
-  // constructor
-  //
-  //   octave_value_list (n, val);
-  //
-  // and supply a default value to create a vector-valued
-  // octave_value_list.
-
-  octave_value_list (octave_idx_type n);
-
   octave_value& elem (octave_idx_type n)
     {
       if (n >= length ())