10#define VIR_HAVE_SIMD_CVT 1
14#if not VIR_HAVE_SIMD_CONCEPTS
17 template <
typename From,
typename To,
typename =
void>
18 struct can_static_simd_cast
22 template <
typename From,
typename To>
23 struct can_static_simd_cast<From, To, std::void_t<decltype(stdx::static_simd_cast<To>(
24 std::declval<const From&>()))>>
25 : std::is_same<decltype(stdx::static_simd_cast<To>(std::declval<const From&>())), To>
41 cvt(
const cvt&) =
delete;
43#if VIR_HAVE_SIMD_CONCEPTS
45 requires std::convertible_to<T, U> or
requires(
const T&x)
47 { stdx::static_simd_cast<U>(x) } -> std::same_as<U>;
50 template <
typename U,
typename = std::enable_if_t<
51 std::disjunction_v<std::is_convertible<T, U>,
52 detail::can_static_simd_cast<T, U>>>>
57 if constexpr (std::is_convertible_v<T, U>)
60 return stdx::static_simd_cast<U>(ref);
This namespace collects libraries and tools authored by Matthias Kretz.
Definition constexpr_wrapper.h:21
C++20 concepts extending the Parallelism TS 2 (which is limited to C++17).