|
Boost : |
From: Rob Smallshire (robert_at_[hidden])
Date: 2001-07-25 05:46:10
Hi Jeremy,
> > Q2.
> >
> > Is it possible to use an internal property map with this
algorithm ?
> > I don't like using an arbitrary mix of internal and external maps.
>
> Yes.
Okay, I've compiled your example code from your last post without
problems using MSVC6sp5.
Here is another example program which fails to compile - the main
difference being that I'm using nested three nested vertex properties.
I've reproduced the code below, and below that is the *enormous*
error message:
Thanks again for your time.
Rob
#include <iostream>
#include <vector>
#include <boost/smart_ptr.hpp>
#include <boost/property_map.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/connected_components.hpp>
class baseT
{
// In my full code baseT is a class template parameter and
// everything else below is wrapped up in a class
};
typedef unsigned int setID;
struct object_t
{
enum { num = 4562 }; /*< Unique id for this tag */
typedef boost::vertex_property_tag kind;
};
struct set_t
{
enum { num = 4563 }; /*< Unique id for this tag */
typedef boost::vertex_property_tag kind;
};
struct component_t
{
enum { num = 4564 };
typedef boost::vertex_property_tag kind;
};
typedef boost::property<object_t, const baseT *> VertexObjectProperty;
typedef boost::property<set_t, setID, VertexObjectProperty>
VertexSetProperty;
typedef boost::property<component_t, int, VertexSetProperty>
VertexComponentProperty;
typedef boost::property<boost::edge_weight_t, int> EdgeWeightProperty;
typedef boost::adjacency_list<boost::listS, boost::setS,
boost::undirectedS, VertexComponentProperty ,EdgeWeightProperty>
Graph;
typedef boost::property_map<Graph, component_t>::type
ComponentPropertyMap;
int main(int argc, char* argv[])
{
Graph G;
ComponentPropertyMap component = boost::get(component_t(), G);
int num = boost::connected_components(G, component);
return 0;
}
~~~~~~~~~~~~~~~~~~~
Error report :
C:/users/rob/dev/utils/boost/boost_1_22_0\boost/property_map.hpp
(342) : error C2784: 'struct boost::iterator_adaptor<Bas
e,Policies,Value,Reference,Pointer,Category,Distance1> __cdecl
boost::operator +(Distance2,struct boost::iterator_adapto
r<Base,Policies,Value,Reference,Pointer,Category,Distance1>)' : could
not deduce template argument for '' from 'enum boo
st::default_color_type *const '
C:/users/rob/dev/utils/boost/boost_1_22_0
\boost/property_map.hpp(311) : see reference to function template
insta
ntiation 'enum boost::default_color_type &__thiscall
boost::iterator_property_map<enum boost::default_color_type *,struc
t boost::adj_list_vertex_property_map<class
boost::adjacency_list<struct boost::listS,struct boost::setS,struct
boost::u
ndirectedS,struct boost::property<struct component_t,int,struct
boost::property<struct set_t,unsigned int,struct boost::
property<struct object_t,class baseT const *,struct
boost::no_property> > >,struct boost::property<enum boost::edge_weig
ht_t,int,struct boost::no_property>,struct boost::no_property>,struct
boost::detail::error_property_not_found,struct boo
st::detail::error_property_not_found const &,enum
boost::vertex_index_t>,enum boost::default_color_type,enum boost::defa
ult_color_type &>::operator [](void *) const' being compiled
C:/users/rob/dev/utils/boost/boost_1_22_0\boost/property_map.hpp
(342) : error C2784: 'struct boost::iterator_adaptor<Bas
e,Policies,Value,Reference,Pointer,Category,Distance1> __cdecl
boost::operator +(struct boost::iterator_adaptor<Base,Pol
icies,Value,Reference,Pointer,Category,Distance1>,Distance2)' : could
not deduce template argument for 'struct boost::it
erator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance
>' from 'enum boost::default_color_type *const '
C:/users/rob/dev/utils/boost/boost_1_22_0
\boost/property_map.hpp(311) : see reference to function template
insta
ntiation 'enum boost::default_color_type &__thiscall
boost::iterator_property_map<enum boost::default_color_type *,struc
t boost::adj_list_vertex_property_map<class
boost::adjacency_list<struct boost::listS,struct boost::setS,struct
boost::u
ndirectedS,struct boost::property<struct component_t,int,struct
boost::property<struct set_t,unsigned int,struct boost::
property<struct object_t,class baseT const *,struct
boost::no_property> > >,struct boost::property<enum boost::edge_weig
ht_t,int,struct boost::no_property>,struct boost::no_property>,struct
boost::detail::error_property_not_found,struct boo
st::detail::error_property_not_found const &,enum
boost::vertex_index_t>,enum boost::default_color_type,enum boost::defa
ult_color_type &>::operator [](void *) const' being compiled
C:/users/rob/dev/utils/boost/boost_1_22_0\boost/property_map.hpp
(342) : error C2784: 'class boost::mutable_random_access
_iterator_archetype<T> __cdecl boost::operator +(int,const class
boost::mutable_random_access_iterator_archetype<T> &)'
: could not deduce template argument for 'overloaded function type'
from 'overloaded function type'
C:/users/rob/dev/utils/boost/boost_1_22_0
\boost/property_map.hpp(311) : see reference to function template
insta
ntiation 'enum boost::default_color_type &__thiscall
boost::iterator_property_map<enum boost::default_color_type *,struc
t boost::adj_list_vertex_property_map<class
boost::adjacency_list<struct boost::listS,struct boost::setS,struct
boost::u
ndirectedS,struct boost::property<struct component_t,int,struct
boost::property<struct set_t,unsigned int,struct boost::
property<struct object_t,class baseT const *,struct
boost::no_property> > >,struct boost::property<enum boost::edge_weig
ht_t,int,struct boost::no_property>,struct boost::no_property>,struct
boost::detail::error_property_not_found,struct boo
st::detail::error_property_not_found const &,enum
boost::vertex_index_t>,enum boost::default_color_type,enum boost::defa
ult_color_type &>::operator [](void *) const' being compiled
C:/users/rob/dev/utils/boost/boost_1_22_0\boost/property_map.hpp
(342) : error C2784: 'class boost::random_access_iterato
r_archetype<T> __cdecl boost::operator +(int,const class
boost::random_access_iterator_archetype<T> &)' : could not dedu
ce template argument for 'overloaded function type' from 'overloaded
function type'
C:/users/rob/dev/utils/boost/boost_1_22_0
\boost/property_map.hpp(311) : see reference to function template
insta
ntiation 'enum boost::default_color_type &__thiscall
boost::iterator_property_map<enum boost::default_color_type *,struc
t boost::adj_list_vertex_property_map<class
boost::adjacency_list<struct boost::listS,struct boost::setS,struct
boost::u
ndirectedS,struct boost::property<struct component_t,int,struct
boost::property<struct set_t,unsigned int,struct boost::
property<struct object_t,class baseT const *,struct
boost::no_property> > >,struct boost::property<enum boost::edge_weig
ht_t,int,struct boost::no_property>,struct boost::no_property>,struct
boost::detail::error_property_not_found,struct boo
st::detail::error_property_not_found const &,enum
boost::vertex_index_t>,enum boost::default_color_type,enum boost::defa
ult_color_type &>::operator [](void *) const' being compiled
C:/users/rob/dev/utils/boost/boost_1_22_0\boost/property_map.hpp
(342) : error C2784: 'Return __cdecl boost::operator +(c
onst class boost::plus_op_first_archetype<Return,BaseFirst> &,const
class boost::plus_op_second_archetype<Return,BaseSec
ond> &)' : could not deduce template argument for 'const class
boost::plus_op_first_archetype<Return,Base> &' from 'enum
boost::default_color_type *const '
C:/users/rob/dev/utils/boost/boost_1_22_0
\boost/property_map.hpp(311) : see reference to function template
insta
ntiation 'enum boost::default_color_type &__thiscall
boost::iterator_property_map<enum boost::default_color_type *,struc
t boost::adj_list_vertex_property_map<class
boost::adjacency_list<struct boost::listS,struct boost::setS,struct
boost::u
ndirectedS,struct boost::property<struct component_t,int,struct
boost::property<struct set_t,unsigned int,struct boost::
property<struct object_t,class baseT const *,struct
boost::no_property> > >,struct boost::property<enum boost::edge_weig
ht_t,int,struct boost::no_property>,struct boost::no_property>,struct
boost::detail::error_property_not_found,struct boo
st::detail::error_property_not_found const &,enum
boost::vertex_index_t>,enum boost::default_color_type,enum boost::defa
ult_color_type &>::operator [](void *) const' being compiled
C:/users/rob/dev/utils/boost/boost_1_22_0\boost/property_map.hpp
(342) : error C2784: 'class boost::addable_archetype<Bas
e> __cdecl boost::operator +(const class
boost::addable_archetype<Base> &,const class
boost::addable_archetype<Base> &)'
: could not deduce template argument for 'const class
boost::addable_archetype<Base> &' from 'enum boost::default_color
_type *const '
C:/users/rob/dev/utils/boost/boost_1_22_0
\boost/property_map.hpp(311) : see reference to function template
insta
ntiation 'enum boost::default_color_type &__thiscall
boost::iterator_property_map<enum boost::default_color_type *,struc
t boost::adj_list_vertex_property_map<class
boost::adjacency_list<struct boost::listS,struct boost::setS,struct
boost::u
ndirectedS,struct boost::property<struct component_t,int,struct
boost::property<struct set_t,unsigned int,struct boost::
property<struct object_t,class baseT const *,struct
boost::no_property> > >,struct boost::property<enum boost::edge_weig
ht_t,int,struct boost::no_property>,struct boost::no_property>,struct
boost::detail::error_property_not_found,struct boo
st::detail::error_property_not_found const &,enum
boost::vertex_index_t>,enum boost::default_color_type,enum boost::defa
ult_color_type &>::operator [](void *) const' being compiled
C:/users/rob/dev/utils/boost/boost_1_22_0\boost/property_map.hpp
(342) : error C2677: binary '+' : no global operator def
ined which takes type 'const struct
boost::detail::error_property_not_found' (or there is no acceptable
conversion)
C:/users/rob/dev/utils/boost/boost_1_22_0
\boost/property_map.hpp(311) : see reference to function template
insta
ntiation 'enum boost::default_color_type &__thiscall
boost::iterator_property_map<enum boost::default_color_type *,struc
t boost::adj_list_vertex_property_map<class
boost::adjacency_list<struct boost::listS,struct boost::setS,struct
boost::u
ndirectedS,struct boost::property<struct component_t,int,struct
boost::property<struct set_t,unsigned int,struct boost::
property<struct object_t,class baseT const *,struct
boost::no_property> > >,struct boost::property<enum boost::edge_weig
ht_t,int,struct boost::no_property>,struct boost::no_property>,struct
boost::detail::error_property_not_found,struct boo
st::detail::error_property_not_found const &,enum
boost::vertex_index_t>,enum boost::default_color_type,enum boost::defa
ult_color_type &>::operator [](void *) const' being compiled
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk