In KDevelop we currently hit this often since our old class
previously returned a reference for the start/end getters of range
and cursor. With the help of C++11 ref qualifiers, we can detect that
and let the compiler give the user an error message:

I must rephrase: I think, without any guard define, this is not even source compatible (even if the use might be in most cases an error).
And with a guard define, this is a hack, as you need to turn it on, which most people won't do at all.
It might have been a good idea to add to the API in KF 5.0, but as we missed that, its now too late, or?

As said, as that change is SIC and only on per define, which nobody will find anyway on their first try, I don't like to include that in the official headers.
If I am mistaken and this is source and binary compatible, please reopen.