// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
-// This file was modified by Oracle on 2020.
-// Modifications copyright (c) 2020, Oracle and/or its affiliates.
+// This file was modified by Oracle on 2020-2021.
+// Modifications copyright (c) 2020-2021, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
#include <type_traits>
-#include <boost/variant/apply_visitor.hpp>
-#include <boost/variant/static_visitor.hpp>
-#include <boost/variant/variant_fwd.hpp>
-
#include <boost/geometry/algorithms/not_implemented.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/mutable_range.hpp>
#include <boost/geometry/core/tag_cast.hpp>
#include <boost/geometry/core/tags.hpp>
+#include <boost/geometry/core/visit.hpp>
+#include <boost/geometry/geometries/adapted/boost_variant.hpp> // for backward compatibility
#include <boost/geometry/geometries/concepts/check.hpp>
{};
-} // namespace dispatch
-#endif // DOXYGEN_NO_DISPATCH
-
-
-namespace resolve_variant {
-
template <typename Geometry>
-struct clear
+struct clear<Geometry, dynamic_geometry_tag>
{
- static inline void apply(Geometry& geometry)
+ static void apply(Geometry& geometry)
{
- dispatch::clear<Geometry>::apply(geometry);
+ traits::visit<Geometry>::apply([](auto & g)
+ {
+ clear<std::remove_reference_t<decltype(g)>>::apply(g);
+ }, geometry);
}
};
-template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
-struct clear<variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
-{
- struct visitor: static_visitor<void>
- {
- template <typename Geometry>
- inline void operator()(Geometry& geometry) const
- {
- clear<Geometry>::apply(geometry);
- }
- };
- static inline void apply(variant<BOOST_VARIANT_ENUM_PARAMS(T)>& geometry)
+template <typename Geometry>
+struct clear<Geometry, geometry_collection_tag>
+{
+ static void apply(Geometry& geometry)
{
- boost::apply_visitor(visitor(), geometry);
+ traits::clear<Geometry>::apply(geometry);
}
};
-} // namespace resolve_variant
+
+} // namespace dispatch
+#endif // DOXYGEN_NO_DISPATCH
/*!
{
concepts::check<Geometry>();
- resolve_variant::clear<Geometry>::apply(geometry);
+ dispatch::clear<Geometry>::apply(geometry);
}