diff libinterp/octave-value/ov.h @ 28633:c897ec8fb5d1

refactor octave_value colon_op function * ov.h, ov.cc (get_colon_op_type): New functions. (make_range): New template function. (make_range<char>): New specialization. (colon_op): Update to use new make_range template.
author John W. Eaton <jwe@octave.org>
date Fri, 31 Jul 2020 13:18:01 -0400
parents 70cdf8de553d
children 98192ec1621f
line wrap: on
line diff
--- a/libinterp/octave-value/ov.h	Fri Jul 31 13:00:48 2020 -0400
+++ b/libinterp/octave-value/ov.h	Fri Jul 31 13:18:01 2020 -0400
@@ -1516,6 +1516,12 @@
   colon_op (const octave_value& base, const octave_value& limit,
             bool is_for_cmd_expr = false)
   {
+    // Note, we need to pass an undefined octave_value object instead of
+    // octave_value (1.0) so that we can properly detect the
+    // two-argument case and correctly pass just two arguments to any
+    // user-defined function that is provided if either base or limit is
+    // an object.
+
     return colon_op (base, octave_value (), limit, is_for_cmd_expr);
   }
 }