Replacing pointers with references for output parameters
- From: Daniel Boles <dboles src gmail com>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: Replacing pointers with references for output parameters
- Date: Wed, 24 May 2017 17:22:11 +0100
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?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]