On 28 June 2017 at 10:47, Jonathan Wakely <gt...@kayari.org> wrote: > On 28 June 2017 at 09:39, Daniel Boles wrote: > > But the main drawback I could think of is this: It would change semantics > > for anyone currently using auto some_character = non_const_ustring[N], as > > the auto would now capture the proxy type, not a gunichar. To get the > > latter, the type would have to be explicitly specified to invoke the > > conversion operator. Or is there a clever way around this that I don't > know? > > There's no way around it. There have been proposals for an "operator > auto" that would make it possible to control the deduced type, mostly > for use by expression templates, but nothing that is part of C++ yet. >
Interesting to hear about the proposals; thanks. > Another downside of a proxy is it can outlive the string, so this > would be undefined (without some internal complexity to track > lifetimes): > Yeah, I thought about that briefly but forgot by the time I was writing the email. I wonder whether sigc::trackable can help here, although maybe that's getting too complex to be worthwhile.
_______________________________________________ gtkmm-list mailing list gtkmm-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtkmm-list