I am using an intel compiler 13.0.1 and with boost 1.52 i get the following error when I use boost::get()
and boost::put()
I use a boost::adjacency_list<>
for my graph type. Properties are assigned to vertices. The get()
and put()
functions help fetch the properties using the boost::property_map <>
interface. I use custom properties so I define my own struct for property storage and a
corresponding tag for property
//G --> my graph_t type
//vd --> vertex
//p --> property fetched from the graph object for vertex vd (used auto c++11)
//
auto p = boost::get(PropertyTag(), G, vd); //fetch the property using put.
modify p (do anything)
boost::put(PropertyTag(), G, vd, p) // update the property using put
When I compile this with intel compiler, I get the following error:
error: no instance of overloaded function "boost::put" matches the argument list
argument types are: (PropertyTag, Graph_t, const size_t, NodeInfo)
boost::put(PropertyTag(), G, vd, p);
^
detected during:
instantiation of ...
Note that the error comes only for boost::put()
and not for boost::get()
.
These get()
and put()
are inside a function say modify_properties()
. This function is used a function object say my_functor(...)
. I use boost::bind()
for the functor and
the function is used inside it.
template <typename graph_t>
struct my_functor {
public:
my_functor() { }
my_functor(graph_t& G_) : G(G_) { }
template<typename vertex>
void operator()(vertex vd) {
modify_properties(vd);
}
private:
graph_t& G;
}
auto f = boost::bind(my_functor<graph_t>(G), _1) //placeholder is for vertex_descriptor
//call the "f" on vertex
f (vd) //goes to functor with vd as placeholder, then calls modify_property(vd), this calls boost::get() and boost::put()..
Does it have anything to do with the function unwrapping using boost::bind
? I know intel 13.0
version is not capable of handling std::bind (C++11)
well. so I use boost bind
. Or boost::bind does not allow to modify any thing (const-ness) because boost::get()
works fine. It is the boost::put()
which is trouble