20#include <cuspatial/geometry/vec_3d.hpp>
39#define CUSPATIAL_ENABLE_IF(...) typename std::enable_if_t<(__VA_ARGS__)>* = nullptr
45template <
typename T,
typename... Ts>
46constexpr bool is_same()
48 return std::conjunction_v<std::is_same<T, Ts>...>;
55template <
typename U,
typename... Ts>
56constexpr bool is_convertible_to()
58 return std::conjunction_v<std::is_convertible<Ts, U>...>;
65template <
typename... Ts>
66constexpr bool is_floating_point()
68 return std::conjunction_v<std::is_floating_point<Ts>...>;
75template <
typename... Ts>
76constexpr bool is_integral()
78 return std::conjunction_v<std::is_integral<Ts>...>;
82constexpr bool is_vec_2d_impl =
false;
84constexpr bool is_vec_2d_impl<vec_2d<T>> =
true;
90constexpr bool is_vec_2d = is_vec_2d_impl<std::remove_cv_t<std::remove_reference_t<T>>>;
93constexpr bool is_vec_3d_impl =
false;
95constexpr bool is_vec_3d_impl<vec_3d<T>> =
true;
101constexpr bool is_vec_3d = is_vec_3d_impl<std::remove_cv_t<std::remove_reference_t<T>>>;
107template <
typename T,
typename... Ts>
108constexpr bool is_same_floating_point()
110 return std::conjunction_v<std::is_same<T, Ts>...> and
111 std::conjunction_v<std::is_floating_point<Ts>...>;
115constexpr bool is_optional_impl =
false;
117constexpr bool is_optional_impl<std::optional<T>> =
true;
123constexpr bool is_optional = is_optional_impl<std::remove_cv_t<std::remove_reference_t<T>>>;
131template <
typename Iterator>
132using iterator_value_type =
typename std::iterator_traits<Iterator>::value_type;
140template <
typename Iterator>
141using iterator_vec_base_type =
typename cuspatial::iterator_value_type<Iterator>::value_type;