|
From: | John W. Eaton |
Subject: | Re: octave_base_value::print const-ness and method overload |
Date: | Mon, 27 Jan 2014 02:48:44 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 |
On 01/25/2014 05:00 PM, Michael Goffioul wrote:
Hi John, Would you mind having a quick look at the patch attached? This implements disp/display overload in classdef, by using the following mapping: - print -> disp - print_with_name -> display There's a ugly hack in octave_classdef::print due to the const-ness of the method. Not really proud of it, but it was more a proof of concept. The question is whether it would be better to remove the const-ness of the method (as for print_with_name) instead?
Hmm. It seems like it would be better to have more const methods rather than fewer and it makes sense to me that this print method should be const since it is not changing the object, just displaying it. Would it be better to make the reference count mutable? Or would that get us into trouble in some other ways?
jwe
[Prev in Thread] | Current Thread | [Next in Thread] |