26 #include <type_traits>
27 #include <geos/util/UnsupportedOperationException.h>
36 ignore_unused_variable_warning(T
const &) {}
39 using std::make_unique;
50 template<
typename To,
typename From>
inline To down_cast(From* f)
53 (std::is_base_of<From,
54 typename std::remove_pointer<To>::type>::value),
55 "target type not derived from source type");
57 assert(f ==
nullptr ||
dynamic_cast<To
>(f) !=
nullptr);
59 return static_cast<To
>(f);
67 void ensureNoCurvedComponents(
const T& geom)
69 if (geom.hasCurvedComponents()) {
70 throw UnsupportedOperationException(
"Curved geometry types are not supported.");
75 void ensureNoCurvedComponents(
const T* geom)
77 ensureNoCurvedComponents(*geom);
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25