I get a warning when compiling below code in VS2008 with MFC enabled. Boost version 1.39
include "boost/flyweight.hpp"
include "boost/flyweight/key_value.hpp"
class Foo
{
public:
Foo(const CString& item) : mfoo(item) {}
const CString& getkeyvalue() const {return mfoo;}
private:
const CString mfoo;
};
struct Conversion
{
const CString& operator() (const Foo& item) const {return item.getkeyvalue();}
};
using namespace boost::flyweights;
flyweight<key_value<CString, Foo, Conversion>, tag<Foo> > flyweight_test;
The last line in the code above causes a warning
d:\work\sourcecode\boost1390\boost\functional\hash\extensions.hpp(72): C4800: 'const wchar_t *': bool 'true' 'false' ( )
d:\work\sourcecode\boost1390\boost\functional\hash\extensions.hpp(71): size_t boost::hash<T>::operator ()(const T &) const [
T=ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t>>
]
d:\work\sourcecode\boost1390\boost\multi_index\hashedindex.hpp(1159): . 'boost:: hash <T> ' [
T=ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t>>
]
, factory, MPL ..
, ?
Edit:
, hash_value
template<typename CharType, typename TraitsType>
std::size_t hash_value(const ATL::CStringT<CharType, TraitsType>& s)
{
return CStringElementTraits<typename TraitsType>::Hash(s);
}