Filip Konvi?ka ha escrito:
Looks like an overzealous or simply misguided warning. Can you please try the following?
#include
#include <cstddef> int main() { std::size_t x=0; boost::hashstd::size_t()(x); }
Same warning? If so, you might ask for inclusion of a suitable #pragma warning(disable...) to the Boost.Hash author.
Yes...in fact,
boost::hash<unsigned int>()(x);
works fine, since the function being called (via boost::hash and boost::call_hash) is defined as
inline std::size_t hash_value(unsigned int v) { return static_caststd::size_t(v); }
Do you mean hash_value(unsigned int) is also invoked when using boost::hashstd::size_t, right?
There are other variants of this function, taking bool, int, etc. as the argument, but no size_t.
This is correct, because std::size_t is a typedef to some builtin unsigned integer type.
I'm not sure what is the official interface of boost::hash, so I don't know whether it's being used correctly in multi_index or not.
I hope Boost.Hash is used correctly by Boost.MultiIndex :) but anyway the issue has little to do with the last lib since the snippet I provided in my previous post (involving only Boost.Hash) replicates the warning. Are you compiling with /Wp64 (Detect 64-Bit Portability Issues)? If so, could you please: a) look in your stdlib headers (most likely in stddef.h) how size_t is defined? b) try the following snippet and report whether the warning persists? #include <cstddef> void foo(unsigned int){} int main() { std::size_t x=0; foo(x); } Thank you! Joaquín M López Muñoz Telefónica, Investigación y Desarrollo