35 #include <type_traits> 47 #if __cplusplus >= 201402L 62 template<
class T,
size_t N>
67 template<
class T,
class... Args>
70 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
76 typedef typename std::remove_extent<T>::type U;
77 return std::unique_ptr<T>(
new U[n]());
80 template<
class T,
class... Args>
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);
110 #endif // GEOS_UTIL_H std::unique_ptr< T > _Single_object
std::unique_ptr< T[]> _Unknown_bound
_Unique_if< T >::_Single_object make_unique(Args &&...args)
Basic namespace for all GEOS functionalities.
void ignore_unused_variable_warning(T const &)
_Unique_if< T >::_Known_bound make_unique(Args &&...)=delete