24#include <geos/util/GEOSException.h>
25#include <geos/util/IllegalArgumentException.h>
26#include <geos/util/TopologyException.h>
27#include <geos/util/GeometricShapeFactory.h>
39ignore_unused_variable_warning(T
const &) {}
42#if __cplusplus >= 201402L
43using std::make_unique;
49 typedef std::unique_ptr<T> _Single_object;
53struct _Unique_if<T[]> {
54 typedef std::unique_ptr<T[]> _Unknown_bound;
57template<
class T, std::
size_t N>
58struct _Unique_if<T[N]> {
59 typedef void _Known_bound;
62template<
class T,
class... Args>
63typename _Unique_if<T>::_Single_object
64make_unique(Args &&... args) {
65 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
69typename _Unique_if<T>::_Unknown_bound
70make_unique(std::size_t n) {
71 typedef typename std::remove_extent<T>::type U;
72 return std::unique_ptr<T>(
new U[n]());
75template<
class T,
class... Args>
76typename _Unique_if<T>::_Known_bound
77make_unique(Args &&...) =
delete;
90template<
typename To,
typename From>
inline To down_cast(From* f)
93 (std::is_base_of<From,
94 typename std::remove_pointer<To>::type>::value),
95 "target type not derived from source type");
97 assert(f ==
nullptr ||
dynamic_cast<To
>(f) !=
nullptr);
99 return static_cast<To
>(f);
107#if __GNUC__ > 0 && __GNUC__ < 5
108#define RETURN_UNIQUE_PTR(x) (std::move(x))
110#define RETURN_UNIQUE_PTR(x) (x)
Basic namespace for all GEOS functionalities.
Definition: geos.h:40