[cfe-dev] SourceLocation comparisons

Robert Ankeney rrankene at gmail.com
Thu Sep 11 11:46:56 PDT 2014


There are times I find it useful to compare two SourceLocations in the same
file. I've noticed the operators ==, != and < are all defined for
SourceLocations, but not >, >= or <=. Is there any reason these are
omitted? For now I'm having to make do with using getRawEncoding() to
compare them and it would make the code look cleaner to avoid this. Of
course I'm assuming the encoded value always increases as you go through
the file, which seems to be the case.

Thanks,
Robert Ankeney
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140911/6df57ef8/attachment.html>


More information about the cfe-dev mailing list