Sebastian Redl
Whatever. Different workaround is to modify boost/iterator/iterator_adaptor.hpp:
+ #if defined(BOOST_MSVC) + #pragma warning(disable: 4244) + #endif void advance(typename super_t::difference_type n) {
BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL(random_access_traversal_tag) m_iterator += n; } + #if defined(BOOST_MSVC) + #pragma warning(default: 4244) + #endif
This is potentially unsafe, of course - nothing prevents you from just passing a HUGE value to +=. The likelyhood, though ... well, it's just a workaround.
No static checking (e.g. warning) can protect you from the possibility of runtime overflows in integer operations. The overflow can occur with or without the warning disabled. These "integer size warnings" are nothing more than a nuisance in most generic code. IMO they should be turned off on the command line. Turning them off in individual source files leaves them cluttered with workarounds and #ifdefs. -- Dave Abrahams Boost Consulting www.boost-consulting.com