[LLVMdev] MSVC compiling issue
Jakob Stoklund Olesen
stoklund at 2pi.dk
Fri Mar 11 19:13:36 PST 2011
On Mar 11, 2011, at 6:40 PM, Ahmed Charles wrote:
> MSVC 9 asserts that the comparision function is symmetric, because of
> what was unclear wording in the standard (there are posts explaining
> this in the boost archive for those interested). The workaround is to
> supply the other overload of the comparator.
That's what I did initially, but apparently the debug library also verifies that the array is ordered, so three version was required.
I finally gave up and stole Howard's upper_bound(), see r127522. It is much less code to write your own algorithms instead of using the STL. Tell your kids!
Interestingly, X86FloatingPoint.cpp has an asymmetric lower_bound that hasn't caused problems. It uses operator<(), though
/jakob
More information about the llvm-dev
mailing list