Boost logo

Boost Users :

Subject: [Boost-users] [graph][test][assign] warning in boost graph
From: Andrey Torba (andreytorba_at_[hidden])
Date: 2009-10-19 05:26:58


Hello All!

In my unit tests i use Graph, Test and Assign libraries (boost 1.39, MSVC
2005).

This is an example to reproduce warning:

#include <boost/graph/topological_sort.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/assign.hpp>

#include <vector>

//#include <boost/test/unit_test.hpp>

int main()
  {
  typedef
    boost::adjacency_list<boost::vecS,
    boost::vecS,
    boost::bidirectionalS>
    G;
  typedef
    boost::graph_traits<G>::vertex_descriptor
    V;

  typedef std::map<V, boost::default_color_type> Map;

  G g;
  std::vector<V> sorted;
  Map m;

  boost::add_vertex(g);

  boost::topological_sort(g,
                          std::back_inserter(sorted),
                          color_map(boost::make_assoc_property_map(m)));

  //boost::assign::list_of<V>(0);
  return 0;
  }

I noticed that when i uncomment both `#include <boost/test/unit_test.hpp>`
and `boost::assign::list_of<V>(0);`
the warning occur:

boost\graph\depth_first_search.hpp(200) : warning C4267: 'argument' :
conversion from 'size_t' to 'unsigned int', possible loss of data

if one of the string is absent there is no warning.

Any thoughts?

-- 
Regards, Andrey




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