Mercurial > octave-nkf
diff src/ov.cc @ 10075:84b0725f4b09
return class types by reference in const Array element access functions
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 08 Jan 2010 11:25:08 +0100 |
parents | f349847c4541 |
children | cd96d29c5efa |
line wrap: on
line diff
--- a/src/ov.cc Fri Jan 08 08:27:45 2010 +0100 +++ b/src/ov.cc Fri Jan 08 11:25:08 2010 +0100 @@ -1424,43 +1424,37 @@ } octave_function * -octave_value::function_value (bool silent) -{ - return rep->function_value (silent); -} - -const octave_function * octave_value::function_value (bool silent) const { return rep->function_value (silent); } octave_user_function * -octave_value::user_function_value (bool silent) +octave_value::user_function_value (bool silent) const { return rep->user_function_value (silent); } octave_user_script * -octave_value::user_script_value (bool silent) +octave_value::user_script_value (bool silent) const { return rep->user_script_value (silent); } octave_user_code * -octave_value::user_code_value (bool silent) +octave_value::user_code_value (bool silent) const { return rep->user_code_value (silent); } octave_fcn_handle * -octave_value::fcn_handle_value (bool silent) +octave_value::fcn_handle_value (bool silent) const { return rep->fcn_handle_value (silent); } octave_fcn_inline * -octave_value::fcn_inline_value (bool silent) +octave_value::fcn_inline_value (bool silent) const { return rep->fcn_inline_value (silent); } @@ -2745,7 +2739,10 @@ decode_subscripts ("subsref", args(1), type, idx); if (! error_state) - retval = args(0).subsref (type, idx, nargout); + { + octave_value tmp = args(0); + retval = tmp.subsref (type, idx, nargout); + } } else print_usage ();