[Boost.Graph] Custom vertex properties with std::shared_ptr member ?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Boost.Graph] Custom vertex properties with std::shared_ptr member ?

Boost - Users mailing list
Hi,

struct CustomVertex {
std::string name;
std::shared_ptr<AbstractNodeClass> _node;
};
typedef boost::adjacency_list < boost::vecS,
boost::vecS,
boost::bidirectionalS,
CustomVertex> Graph;


Vertex DGManager::createVertex(const std::string &name, std::shared_ptr<AbstractNodeClass> Ptr)
{
_activeVertex = boost::add_vertex(CustomVertex{name, nodePtr}, _g);
return _activeVertex;
}

  With Visual Studio 2017, the above is fine but with GCC 7.5.0, I get a seg-fault on application exit. Looking at the stack trace, it looks like a problem in the CustomVertex destructor.

  Is there some restriction as to what types we can use as member variable of Custom Vertex Properties ?

Kind regards
--
Nicholas Yue
Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5
Custom Dev - C++ porting, OSX, Linux, Windows
http://au.linkedin.com/in/nicholasyue
https://vimeo.com/channels/naiadtools

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users