From: James T. <zak...@ma...> - 2009-02-13 13:11:42
|
On 13 Feb 2009, at 09:23, Vivian Meazza wrote: > It compiles here under MSVC8, but I’m aware of at least one other > report of this problem. The current analysis is that if you compile > in release mode, it works OK, but the error appears in debug mode. > If you try that, I would be interested in the result. One thing to try, would be adding an overload of LowerLimitOfType, which takes two const FGPositioned*. In general I'm lack sufficient information to make sense of this failure, or especially why release/ debug makes a difference. Presumably the MSVC STL implementation uses extra/different/stricter checks in debug mode. Checking the STL docs, the definition of StrickWeakOrdering implies that both arguments must have the same type, so my approach is illegal - it is an idiom I've used before without problems, in other code that was built with gcc and MSVC, but it's not entirely unreasonable for MSVC to complain. So probably the real solution is to use some alternative to lower_/ upper_bound ... but still keeps the binary-search efficiency. Yuck. James |