Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-05-10 22:44:33


The InputIteratorConcept is requiring that the difference_type of the
iterator be a signed integer. However, the SignedIntegerConcept does not
have a specialization for whatever type the typedef intmax_t is. A
specialization needs to be added.

On Thu, 10 May 2001, Joel Young wrote:

jdy> From: Jeremy Siek <jsiek_at_[hidden]> Date: Fri, 20 Apr 2001 13:34:46 -0500 (EST)
jdy> > Hope this helps!
jdy>
jdy> Jeremy, it worked great!
jdy>
jdy> Now I am getting the following error with the GCC 2.97 snapshot 20010417
jdy> on BOOST_1_21_1. I get no compile or run error with GCC 2.95.3.
jdy>
jdy> Is this another case of my ignorance or is something broken? Notice the
jdy> error in your boost_concept_check.h in g++-v3...
jdy>
jdy> Here is the error trace:
jdy>
jdy> **********BEGIN TRACE**********
jdy> /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
jdy> /cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/include/g++-v3/bits/boost_concept_check.h: In
jdy> member function `void __gnu_cxx::_SignedIntegerConcept<_Tp>::__constraints() [with _Tp = intmax_t]':
jdy> /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>]'
jdy> /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>]'
jdy> /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> >]'
jdy> /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>]'
jdy> test.C:48: instantiated from here
jdy> /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'
jdy> undeclared (first use this function)
jdy> /cs/src/gcc/gcc-2.96experimental/SunOS5.7-latest/include/g++-v3/bits/boost_concept_check.h:99: (Each
jdy> undeclared identifier is reported only once for each function it appears
jdy> in.)
jdy> make: *** [test.o] Error 1
jdy> ***********END TRACE***********
jdy>
jdy> Here is the code that generated the above error:
jdy>
jdy> ***********BEGIN CODE**********
jdy> #include <boost/graph/graph_traits.hpp>
jdy> #include <boost/graph/adjacency_list.hpp>
jdy>
jdy> template <class Graph, class Property_T>
jdy> struct matches
jdy> {
jdy> typedef typename boost::graph_traits<Graph>::vertex_descriptor
jdy> VertDesc;
jdy> typedef typename boost::property_map<Graph, Property_T>::const_type
jdy> ValueMap;
jdy> typedef typename boost::property_traits<ValueMap>::value_type
jdy> ValueType;
jdy>
jdy> const ValueType& m_value;
jdy> ValueMap m_map;
jdy>
jdy> // provide the graph object and the data item to be compared against
jdy> matches(const Graph& p_g, const ValueType& p_value) :
jdy> m_value(p_value),
jdy> m_map(boost::get(Property_T(),p_g))
jdy> { }
jdy>
jdy> // returns true if p_vertex holds the same value as m_value
jdy> inline bool operator()(const VertDesc& p_vertex) const {
jdy> return m_value==boost::get(m_map,p_vertex);
jdy> }
jdy> };
jdy>
jdy> int main(int,char*[]) {
jdy>
jdy> typedef boost::property<boost::vertex_name_t, size_t
jdy> > vertexproperty_t;
jdy>
jdy> typedef boost::adjacency_list< boost::mapS, // Edge
jdy> boost::vecS, // Vertex
jdy> boost::bidirectionalS,
jdy> vertexproperty_t> graph_t;
jdy>
jdy> typedef boost::graph_traits<graph_t>::vertex_iterator vi_t;
jdy>
jdy> graph_t G;
jdy>
jdy> size_t Val;
jdy>
jdy> std::pair<vi_t,vi_t> p = boost::vertices(G);
jdy>
jdy> vi_t f =
jdy> find_if(p.first,p.second,matches<graph_t,boost::vertex_name_t>(G, Val));
jdy>
jdy> return 0;
jdy> }
jdy> ************END CODE***********
jdy>
jdy> I don't understand why it wants a signed integer. Any suggestions?
jdy>
jdy>
jdy> Thanks,
jdy> Joel
jdy>
jdy> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
jdy>
jdy>
jdy> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
jdy>
jdy>
jdy>

----------------------------------------------------------------------
 Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
 Ph.D. Candidate email: jsiek_at_[hidden]
 Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------


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