Hi,
I'm trying to figure out how to use property_map in boost graph, after
I reduce the problem to the minimal I still don't know what the
problem is. Can someone help with this? Thanks in advance.
Here is the simplified example:
#include <iostream>
#include <map>
#include <string>
#include
using std::string;
using boost::put;
using boost::get;
int main()
{
typedef std::map Map;
typedef boost::associative_property_map<Map> PMap;
PMap map;
put(map, string("acc"), 1);
get(map, string("acc"));
return EXIT_SUCCESS;
}
This version compiles OK with mingw 4.4, but crash when running. If I
make a change from "PMap map;" into "PMap map();" which I think is
equivalent, then this code fail to compile, and say
D:\myproject\test\boost_test\property_map\pp.cpp: In function 'int main()':
D:\myproject\test\boost_test\property_map\pp.cpp:15: error: no matching function
for call to 'put(main()::PMap (&)(), std::string, int)'
D:\myproject\test\boost_test\property_map\pp.cpp:16: error: no matching function
for call to 'get(main()::PMap (&)(), std::string)'
What's the problem is?
--
Yaohua Xiong
Traffic and Transportation Engineering College, Tongji Univ.
Cao An Road 4800#, Jia Ding District, Shanghai, China