Boost logo

Boost Users :

From: Robert S. Grimes (rsgrimes_at_[hidden])
Date: 2006-02-10 16:26:44


Hi all,

Using Boost 1.33.1 serialization library with Micro$oft Visual Studio 2005,
I get two minor warnings while compiling the demo_xml.cpp program. They are
in boost/serialization/collections_save_imp.hpp. Lines 36 and 37 in the
function template save_collection are the culprit, resulting in warnings of
the form:

  warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned
int', possible loss of data

These are the problem lines:
  unsigned int count = s.size();
  ar << make_nvp("count", const_cast<const unsigned int &>(count));

Changing the "unsigned int" to "size_t" fixes the warnings, like this:
  size_t count = s.size();
  ar << make_nvp("count", const_cast<const size_t &>(count));

Trivial problem, I admit, but warnings are warnings...

Cheers,
-RSG


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net