25 #include <geos/util/GEOSException.h>
26 #include <geos/util/IllegalArgumentException.h>
27 #include <geos/util/TopologyException.h>
31 #include <geos/util/GeometricShapeFactory.h>
35 #include <type_traits>
44 ignore_unused_variable_warning(T
const &) {}
47 #if __cplusplus >= 201402L
48 using std::make_unique;
54 typedef std::unique_ptr<T> _Single_object;
58 struct _Unique_if<T[]> {
59 typedef std::unique_ptr<T[]> _Unknown_bound;
62 template<
class T,
size_t N>
63 struct _Unique_if<T[N]> {
64 typedef void _Known_bound;
67 template<
class T,
class... Args>
68 typename _Unique_if<T>::_Single_object
69 make_unique(Args &&... args) {
70 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
74 typename _Unique_if<T>::_Unknown_bound
75 make_unique(
size_t n) {
76 typedef typename std::remove_extent<T>::type U;
77 return std::unique_ptr<T>(
new U[n]());
80 template<
class T,
class... Args>
81 typename _Unique_if<T>::_Known_bound
82 make_unique(Args &&...) =
delete;
95 template<
typename To,
typename From>
inline To down_cast(From* f)
98 (std::is_base_of<From,
99 typename std::remove_pointer<To>::type>::value),
100 "target type not derived from source type");
102 assert(f ==
nullptr ||
dynamic_cast<To
>(f) !=
nullptr);
104 return static_cast<To
>(f);
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26