GNOME Bugzilla – Bug 769502
making Glib::RefPtr<>::operator bool() explicit breaks comparison to zero
Last modified: 2016-08-05 10:44:07 UTC
Created attachment 332698 [details] Reproducer which exhibits the problem. I've tried building Ardour (https://github.com/Ardour/ardour) from its git master branch and found that it tripped over "if (some_glib_ref_ptr == 0) ..." comparisons which worked with previous versions of glibmm (up to 2.48.x). The attached reproducer program exhibits the issue.
NB: in the meantime, the ardour maintainer applied a workaround. The effect can be seen up to and including this commit: https://github.com/Ardour/ardour/commit/d6fd0486aef08fcccf013d889734971ed01eaedd
I think this is as intended with the switch to C++11. With C++11 you should be using nullptr instead of 0, though it's superfluous anyway. if(some_glib_ref_ptr) would be fine. That's a very small price to pay to avoid the other implicit conversions.