Fix some hash /W4 warnings. Fixes #3648

[SVN r57839]
This commit is contained in:
Daniel James
2009-11-21 19:40:54 +00:00
parent 32917c2bd1
commit b647aba2cd
2 changed files with 7 additions and 8 deletions

View File

@@ -20,6 +20,7 @@ int main()
boost::hash<library::book> book_hasher; boost::hash<library::book> book_hasher;
std::size_t knife_hash_value = book_hasher(knife); std::size_t knife_hash_value = book_hasher(knife);
(void)knife_hash_value; // suppress unused variable warning
// If std::unordered_set was available: // If std::unordered_set was available:
// //

View File

@@ -19,19 +19,17 @@ int main() {}
#include <boost/detail/lightweight_test.hpp> #include <boost/detail/lightweight_test.hpp>
#include <complex>
#include <sstream>
#include <boost/limits.hpp>
#if defined(BOOST_MSVC) #if defined(BOOST_MSVC)
#pragma warning(push)
#pragma warning(disable:4244) // conversion from 'unsigned long' to 'unsigned short', possible loss of data #pragma warning(disable:4244) // conversion from 'unsigned long' to 'unsigned short', possible loss of data
#pragma warning(disable:4245) // conversion from 'int' to 'const unsigned short', signed/unsigned mismatch
#pragma warning(disable:4305) // truncation from 'double' to 'const std::complex<float>::_Ty'
#pragma warning(disable:4309) // truncation of constant value
#pragma warning(disable:4512) // assignment operator could not be generated #pragma warning(disable:4512) // assignment operator could not be generated
#endif #endif
#if defined(BOOST_MSVC) #include <complex>
#pragma warning(pop) #include <sstream>
#endif #include <boost/limits.hpp>
template <class T> template <class T>
void generic_complex_tests(std::complex<T> v) void generic_complex_tests(std::complex<T> v)