Boost logo

Boost :

From: Joel Young (jdy_at_[hidden])
Date: 2001-05-10 22:19:37


From: Jeremy Siek <jsiek_at_[hidden]> Date: Fri, 20 Apr 2001 13:34:46 -0500 (EST)
> Hope this helps!

Jeremy, it worked great!

Now I am getting the following error with the GCC 2.97 snapshot 20010417
on BOOST_1_21_1. I get no compile or run error with GCC 2.95.3.

Is this another case of my ignorance or is something broken? Notice the
error in your boost_concept_check.h in g++-v3...

Here is the error trace:

**********BEGIN TRACE**********
/cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/bin/g++ -I/pro/gnome//include -I/pro/gnome//include/w3c-libwww -I/u/jdy/boost_1_21_1 -I/cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/include/g++-v3/ext -g -DHAVE_CONFIG_H -DDEBUG -DERRNO_DONE -ftemplate-depth-35 -c test.C
/cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/include/g++-v3/bits/boost_concept_check.h: In
   member function `void __gnu_cxx::_SignedIntegerConcept<_Tp>::__constraints() [with _Tp = intmax_t]':
/cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/include/g++-v3/bits/boost_concept_check.h:26: instantiated from `void __gnu_cxx::__function_requires() [with _Concept = __gnu_cxx::_SignedIntegerConcept<intmax_t>]'
/cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/include/g++-v3/bits/boost_concept_check.h:410: instantiated from `void __gnu_cxx::_InputIteratorConcept<_Tp>::__constraints() [with _Tp = boost::iterator_adaptor<size_t, boost::counting_iterator_policies<size_t>, size_t, const size_t&, const size_t*, std::random_access_iterator_tag, intmax_t>]'
/cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/include/g++-v3/bits/boost_concept_check.h:26: instantiated from `void __gnu_cxx::__function_requires() [with _Concept = __gnu_cxx::_InputIteratorConcept<boost::iterator_adaptor<size_t, boost::counting_iterator_policies<size_t>, size_t, const size_t&, const size_t*, std::random_access_iterator_tag, intmax_t> >]'
/cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/include/g++-v3/bits/stl_algo.h:209: instantiated from `_InputIter std::find_if(_InputIter, _InputIter, _Predicate) [with _InputIter = boost::iterator_adaptor<size_t, boost::counting_iterator_policies<size_t>, size_t, const size_t&, const size_t*, std::random_access_iterator_tag, intmax_t>, _Predicate = matches<int main(int, char**)::graph_t, boost::vertex_name_t>]'
test.C:48: instantiated from here
/cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/include/g++-v3/bits/boost_concept_check.h:99: `__error_type_must_be_a_signed_integer_type'
   undeclared (first use this function)
/cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/include/g++-v3/bits/boost_concept_check.h:99: (Each
   undeclared identifier is reported only once for each function it appears
   in.)
make: *** [test.o] Error 1
***********END TRACE***********

Here is the code that generated the above error:

***********BEGIN CODE**********
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>

template <class Graph, class Property_T>
struct matches
{
  typedef typename boost::graph_traits<Graph>::vertex_descriptor
      VertDesc;
  typedef typename boost::property_map<Graph, Property_T>::const_type
      ValueMap;
  typedef typename boost::property_traits<ValueMap>::value_type
      ValueType;

  const ValueType& m_value;
  ValueMap m_map;

  // provide the graph object and the data item to be compared against
  matches(const Graph& p_g, const ValueType& p_value) :
    m_value(p_value),
    m_map(boost::get(Property_T(),p_g))
  { }
  
  // returns true if p_vertex holds the same value as m_value
  inline bool operator()(const VertDesc& p_vertex) const {
    return m_value==boost::get(m_map,p_vertex);
  }
};

int main(int,char*[]) {

 typedef boost::property<boost::vertex_name_t, size_t
> vertexproperty_t;

 typedef boost::adjacency_list< boost::mapS, // Edge
                                boost::vecS, // Vertex
                                boost::bidirectionalS,
                                vertexproperty_t> graph_t;

 typedef boost::graph_traits<graph_t>::vertex_iterator vi_t;

 graph_t G;

 size_t Val;
 
 std::pair<vi_t,vi_t> p = boost::vertices(G);

 vi_t f =
   find_if(p.first,p.second,matches<graph_t,boost::vertex_name_t>(G, Val));

 return 0;
}
************END CODE***********

I don't understand why it wants a signed integer. Any suggestions?

Thanks,
Joel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk