20#include <cuspatial/geometry/vec_3d.hpp>
22#include <thrust/optional.h>
41#define CUSPATIAL_ENABLE_IF(...) typename std::enable_if_t<(__VA_ARGS__)>* = nullptr
47template <
typename T,
typename... Ts>
48constexpr bool is_same()
50 return std::conjunction_v<std::is_same<T, Ts>...>;
57template <
typename U,
typename... Ts>
58constexpr bool is_convertible_to()
60 return std::conjunction_v<std::is_convertible<Ts, U>...>;
67template <
typename... Ts>
68constexpr bool is_floating_point()
70 return std::conjunction_v<std::is_floating_point<Ts>...>;
77template <
typename... Ts>
78constexpr bool is_integral()
80 return std::conjunction_v<std::is_integral<Ts>...>;
84constexpr bool is_vec_2d_impl =
false;
86constexpr bool is_vec_2d_impl<vec_2d<T>> =
true;
92constexpr bool is_vec_2d = is_vec_2d_impl<std::remove_cv_t<std::remove_reference_t<T>>>;
95constexpr bool is_vec_3d_impl =
false;
97constexpr bool is_vec_3d_impl<vec_3d<T>> =
true;
103constexpr bool is_vec_3d = is_vec_3d_impl<std::remove_cv_t<std::remove_reference_t<T>>>;
109template <
typename T,
typename... Ts>
110constexpr bool is_same_floating_point()
112 return std::conjunction_v<std::is_same<T, Ts>...> and
113 std::conjunction_v<std::is_floating_point<Ts>...>;
117constexpr bool is_optional_impl =
false;
119constexpr bool is_optional_impl<std::optional<T>> =
true;
125constexpr bool is_optional = is_optional_impl<std::remove_cv_t<std::remove_reference_t<T>>>;
133template <
typename Iterator>
134using iterator_value_type =
typename std::iterator_traits<Iterator>::value_type;
142template <
typename Iterator>
143using iterator_vec_base_type =
typename cuspatial::iterator_value_type<Iterator>::value_type;