diff --git a/geometry.hpp/include/mapbox/geometry/feature.hpp b/geometry.hpp/include/mapbox/geometry/feature.hpp index 7008198..a1fab3d 100644 --- a/geometry.hpp/include/mapbox/geometry/feature.hpp +++ b/geometry.hpp/include/mapbox/geometry/feature.hpp @@ -12,8 +12,6 @@ namespace mapbox { namespace geometry { -struct value; - struct null_value_t { constexpr null_value_t() {} @@ -26,21 +24,28 @@ constexpr bool operator<(const null_value_t&, const null_value_t&) { return fals constexpr null_value_t null_value = null_value_t(); +struct property_vector; +struct property_map; // Multiple numeric types (uint64_t, int64_t, double) are present in order to support // the widest possible range of JSON numbers, which do not have a maximum range. // Implementations that produce `value`s should use that order for type preference, // using uint64_t for positive integers, int64_t for negative integers, and double // for non-integers and integers outside the range of 64 bits. -using value_base = mapbox::util::variant>, - mapbox::util::recursive_wrapper>>; +using value = mapbox::util::variant; -struct value : value_base -{ - using value_base::value_base; +struct property_vector : public std::vector { + using std::vector::vector; + property_vector() : std::vector(){}; + property_vector(const std::vector &_v): std::vector(_v){} }; -using property_map = std::unordered_map; +struct property_map : public std::unordered_map { + using std::unordered_map::unordered_map; + property_map() : std::unordered_map() {} + property_map(const std::unordered_map &_v): std::unordered_map(_v) {} + property_map(std::unordered_map &&_v) : std::unordered_map(_v) {} +}; // The same considerations and requirement for numeric types apply as for `value_base`. using identifier = mapbox::util::variant; diff --git a/geometry.hpp/include/mapbox/geometry/geometry.hpp b/geometry.hpp/include/mapbox/geometry/geometry.hpp index a9d072b..f1a9b51 100644 --- a/geometry.hpp/include/mapbox/geometry/geometry.hpp +++ b/geometry.hpp/include/mapbox/geometry/geometry.hpp @@ -19,7 +19,7 @@ template class Cont = std::vector> struct geometry_collection; template -using geometry_base = mapbox::util::variant, +using geometry = mapbox::util::variant, line_string, polygon, multi_point, @@ -27,19 +27,6 @@ using geometry_base = mapbox::util::variant, multi_polygon, geometry_collection>; -template -struct geometry : geometry_base -{ - using coordinate_type = T; - using geometry_base::geometry_base; - - /* - * The default constructor would create a point geometry with default-constructed coordinates; - * i.e. (0, 0). Since this is not particularly useful, and could hide bugs, it is disabled. - */ - geometry() = delete; -}; - template class Cont> struct geometry_collection : Cont> {