Initializing a polygon in boost::geometry

boost, boost-geometry, c++, polygon

Solution

append(P, make<point_2d>(*xi, *yi));

Problem

I am new to the generic geometry library that is proposed for inclusion with boost: ``` http://geometrylibrary.geodan.nl/ ``` I have two vectors `vector<int> Xb, Yb` that I am trying to create a polygon from. I am trying to get something along the lines of the following code snippet: ``` polygon_2d P; vector<double>::const_iterator xi; vector<double>::const_iterator yi; for (xi=Xb.begin(), yi=Yb.begin(); xi!=Xb.end(); ++xi, ++yi) P.push_back (make<point_2d>(*xi, *yi)); ``` The above code does not work, complaining that `P` does not have a `push_back` member function. How do I initialize the polygon from points that have coordinates `vector<int> Xb,vector<int> Yb`?

Original source