geom/ops: workaround ICE using requires for distance

clang requires `A<S,T>` for the `enable_if` condition, and this provokes
an ICE under GCC. A `requires` clause works identically and satisfies
both compilers.
This commit is contained in:
Danny Robson 2021-04-19 16:47:22 +10:00
parent 50b2105df5
commit 59c1c9cc9e

View File

@ -55,12 +55,12 @@ namespace cruft::geom {
size_t S,
typename T,
template <size_t,typename> class A,
template <size_t,typename> class B,
typename = std::enable_if_t<
!std::is_same_v<cruft::point<S,T>, A<S,T>> &&
!std::is_same_v<cruft::point<S,T>, B<S,T>>
>
template <size_t,typename> class B
>
requires (
!std::is_same_v<cruft::point<S,T>, A<S,T>> &&
!std::is_same_v<cruft::point<S,T>, B<S,T>>
)
T
distance (A<S,T>, B<S,T>);