0

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

Pogo
  • 475
  • 3
  • 19
  • If I unwrap the function: modify_properties(vd) in the functor my_func(), I dont get the error. I guess it is because of boost::bind, but I dont know how to fix this. – Pogo Jun 27 '14 at 18:43
  • 1
    the bind is not involved. Can you just make a [SSCCE](http://www.sscce.org/)? In all likelihood you will **[Answer your own question](http://blog.jerryorr.com/2014/04/solve-your-problem-by-almost-asking.html)** and otherwise your problem description will become tangible (as opposed to the mess of inaccurate descriptions you posted. Sorry to be blunt). It looks to me, you only need Boost PropertyMap to demonstrate the issue. I wager it could be done in 5 lines of code – sehe Jun 28 '14 at 18:13

0 Answers0