Skip to content

Commit

Permalink
Inherit constructor for polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed May 6, 2016
1 parent f901b40 commit d705c09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/mapbox/geometry/polygon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct polygon : Cont<linear_ring<T>>
using coordinate_type = T;
using linear_ring_type = linear_ring<T>;
using container_type = Cont<linear_ring_type>;
using container_type::container_type;
};

}}
9 changes: 7 additions & 2 deletions tests/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ static void testMultiLineString() {
}

static void testPolygon() {
polygon<double> pg;
assert(pg.size() == 0);
polygon<double> pg1;
assert(pg1.size() == 0);

polygon<double> pg2({{{0, 1}}});
assert(pg2.size() == 1);
assert(pg2[0].size() == 1);
assert(pg2[0][0] == point<double>(0, 1));
}

static void testMultiPolygon() {
Expand Down

0 comments on commit d705c09

Please sign in to comment.