35ignore_unused_variable_warning(T
const &) {}
38#if __cplusplus >= 201402L
39using std::make_unique;
45 typedef std::unique_ptr<T> _Single_object;
49struct _Unique_if<T[]> {
50 typedef std::unique_ptr<T[]> _Unknown_bound;
53template<
class T, std::
size_t N>
54struct _Unique_if<T[N]> {
55 typedef void _Known_bound;
58template<
class T,
class... Args>
59typename _Unique_if<T>::_Single_object
60make_unique(Args &&... args) {
61 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
65typename _Unique_if<T>::_Unknown_bound
66make_unique(std::size_t n) {
67 typedef typename std::remove_extent<T>::type U;
68 return std::unique_ptr<T>(
new U[n]());
71template<
class T,
class... Args>
72typename _Unique_if<T>::_Known_bound
73make_unique(Args &&...) =
delete;
86template<
typename To,
typename From>
inline To down_cast(From* f)
89 (std::is_base_of<From,
90 typename std::remove_pointer<To>::type>::value),
91 "target type not derived from source type");
93 assert(f ==
nullptr ||
dynamic_cast<To
>(f) !=
nullptr);
95 return static_cast<To
>(f);
103#if __GNUC__ > 0 && __GNUC__ < 5
104#define RETURN_UNIQUE_PTR(x) (std::move(x))
106#define RETURN_UNIQUE_PTR(x) (x)
Basic namespace for all GEOS functionalities.
Definition: geos.h:39