James Turner a écrit :
> On 30 Aug 2008, at 23:16, Stefan C. Müller wrote:
>
>
>>> As far as I can tell, this is not true. The third parameter type is
>>> independant from the type of the container, and should only match
>>> the type of the second parameter of the predicate. The current code
>>> compile under MSVC 7.1 and under MSVC 9.0. Looking at the
>>> lower_bound code in the MSVC 8 <algorithm>, I think it is the same
>>> for VS2005.
>>> What is your msvc version, and what is the error message you are
>>> seeing ?
>>>
>>> -Fred
>>>
>> I'm using VC Express 2005 (SP1). I must say I was rather confused to
>> see
>> that this does not work in MSVC. I tracked it down into xutility and
>> found that the error was actually caused by debugging code that will
>> later be thrown away be the optimizer anyway. Heres the part:
>>
>
> Interesting - this is my 'fault' for using lower_bound, and actually
> the code in question has some other issues I found doing better
> testing, but equally, as Fred says, I'm surprised yuor MSVC is
> rejecting the current code.
>
> I don't have a problem with accomodating MSVC of course, but I'd like
> to be clear why changes are required, and this seems like an odd case.
>
As Stefan says, the ( debugging ) code expects the predicate is
commutative. Maybe there is a symbol to disable debugging code to be
generated, or we could provide the class a second operator() :
bool operator()(const std::string& aB, const airport_map::value_type& aA) const
{
return mOrdering->compare(aB,aA.first);
}
Or make the change Stefan suggests.
-Fred
--
Frédéric Bouvier
http://my.fotolia.com/frfoto/ Photo gallery
http://fgsd.sourceforge.net/ FlightGear Scenery Designer
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel