implicitly-declared Gtk::TreeValueProxy copy constructor is deprecated, due to user-provided operator=
When building a project that I have where I use generic code to pass around a bunch of TreeValueProxy
s, and end up moving them, I get this warning. Copying is the same (of course).
warning: implicitly-declared ‘constexpr Gtk::TreeValueProxy<int>::TreeValueProxy(const Gtk::TreeValueProxy<int>&)’ is deprecated [-Wdeprecated-copy]
110 | function(std::move(proxies)...);
[ . . . ]
/test/list_store.cpp:1:
/usr/include/gtkmm-3.0/gtkmm/treeiter.h:277:31: note: because ‘Gtk::TreeValueProxy<int>’ has user-provided ‘Gtk::TreeValueProxy<ColumnType>& Gtk::TreeValueProxy<ColumnType>::operator=(const Gtk::TreeValueProxy<ColumnType>&) [with ColumnType = int]’
277 | TreeValueProxy<ColumnType>& operator=(const TreeValueProxy<ColumnType>&);
| ^~~~~~~~
You might think, then, that we just need to explicitly declare the copy constructor to do whatever we want - i.e. whatever it's currently doing - i.e. presumably to just do a normal =default
copy, i.e. one that also refers to the same row/column.
However, it might also be easier. treeiter.h
declares operator=()
like so:
// no copy assignment
TreeValueProxy<ColumnType>& operator=(const TreeValueProxy<ColumnType>&);
...but never defines it. So I infer that // no copy assignment
just means we want to prevent operator=(const TreeValueProxy<ColumnType>&)
from being called, since doing so would be a link error. Then we should just =delete
it, not implement it. IIRC that might prevent the warning above, while being functionally equivalent.
I'll try to test and submit a patch for that soon-ish but wanted to log the warning. Also, so far I only checked this against gtkmm
3, not 4.