Re: Replacing pointers with references for output parameters
- From: Murray Cumming <murrayc murrayc com>
- To: Daniel Boles <dboles src gmail com>, gtkmm-list <gtkmm-list gnome org>
- Subject: Re: Replacing pointers with references for output parameters
- Date: Fri, 26 May 2017 12:45:54 +0200
On Wed, 2017-05-24 at 17:22 +0100, Daniel Boles wrote:
Some things like Gtk::SpinButton::signal_input() still take pointers
in order to write output parameters. In this case, there's a double*
new_value, which users must write back to with the converted value
represented by whatever string was typed in: *new_value =
get_value(blah)
It would be cleaner C++ to implement such arguments as out references
instead. Is there a reason this was not doing the first time around,
or can we move towards it now?
If there's no comment saying why it's a pointer, you could try to fix
it. If that shows why it should still be a pointer, it would be nice to
have a comment saying that. Thanks.
--
Murray Cumming
murrayc murrayc com
www.murrayc.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]