Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2004-10-12 21:55:25


This is actually an error for me since I have "warnings as errors"
turned on. For the Dinkumware lib, type_info::operator== and operator!=
return int instead of bool. This causes problems with the
any_bridge_compare class in named_slot_map.hpp

template<typename Compare, typename Key>
class any_bridge_compare {
...
   bool operator()(const any& k1, const any& k2) const
   {
     if (k1.type() == typeid(front_type))
       return k2.type() != typeid(front_type);
-------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This results in warning C4800: 'int' : forcing value to bool 'true' or
'false' (performance warning)

I recommend changing the line in question to:
       return !(k2.type() == typeid(front_type));

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk