File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,19 @@ namespace geom {
2929
3030class nullgeom_t
3131{
32+ public:
33+ static std::size_t num_geometries () noexcept { return 0 ; }
34+
35+ constexpr friend bool operator ==(nullgeom_t , nullgeom_t ) noexcept
36+ {
37+ return true ;
38+ }
39+
40+ constexpr friend bool operator !=(nullgeom_t , nullgeom_t ) noexcept
41+ {
42+ return false ;
43+ }
44+
3245}; // class nullgeom_t
3346
3447class point_t
@@ -42,6 +55,8 @@ class point_t
4255
4356 constexpr point_t (double x, double y) noexcept : m_x(x), m_y(y) {}
4457
58+ static std::size_t num_geometries () noexcept { return 1 ; }
59+
4560 constexpr double x () const noexcept { return m_x; }
4661 constexpr double y () const noexcept { return m_y; }
4762
@@ -83,6 +98,8 @@ class linestring_t : public point_list_t
8398 : point_list_t (list.begin(), list.end())
8499 {}
85100
101+ static std::size_t num_geometries () noexcept { return 1 ; }
102+
86103}; // class linestring_t
87104
88105class ring_t : public point_list_t
@@ -107,6 +124,8 @@ class polygon_t
107124
108125 explicit polygon_t (ring_t &&ring) : m_outer(std::move(ring)) {}
109126
127+ static std::size_t num_geometries () noexcept { return 1 ; }
128+
110129 ring_t const &outer () const noexcept { return m_outer; }
111130
112131 ring_t &outer () noexcept { return m_outer; }
You can’t perform that action at this time.
0 commit comments