# HG changeset patch # User Rik # Date 1453247888 28800 # Node ID 2bbbbb96f631aada05500e9ad9673a461e0c8785 # Parent 358aa7fcbd33a75258035afdc0c74ce4acc4f1c4 ov-complex.cc: Incorporate gripe_complex_index into calling fcn. * ov-complex.cc (gripe_complex_index): Delete function. * ov-complex.cc (octave_complex::index_vector): Incorporate gripe_complex_index code into function. diff -r 358aa7fcbd33 -r 2bbbbb96f631 libinterp/octave-value/ov-complex.cc --- a/libinterp/octave-value/ov-complex.cc Tue Jan 19 15:43:18 2016 -0800 +++ b/libinterp/octave-value/ov-complex.cc Tue Jan 19 15:58:08 2016 -0800 @@ -79,16 +79,6 @@ } }; -static void -gripe_complex_index (const Complex& idx) -{ - std::ostringstream buf; - buf << std::real (idx) << std::showpos << std::imag (idx) << "i"; - complex_index_exception e (buf.str ()); - - throw e; -} - static octave_base_value * default_numeric_demotion_function (const octave_base_value& a) { @@ -136,12 +126,15 @@ return tmp.do_index_op (idx, resize_ok); } +// Can't make an index_vector from a complex number. Throw an error. idx_vector octave_complex::index_vector (bool) const { - gripe_complex_index (scalar); + std::ostringstream buf; + buf << std::real (scalar) << std::showpos << std::imag (scalar) << "i"; + complex_index_exception e (buf.str ()); - return idx_vector (); + throw e; } double