From 87d442772c553d818b250345107dce20ce085508 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 16 Apr 2018 15:58:13 +1000 Subject: [PATCH] geom/ops: remove point-point distance via sfinae point-point distance is already defined outside of the geom namespace --- geom/ops.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/geom/ops.hpp b/geom/ops.hpp index 304edc20..1cf82c85 100644 --- a/geom/ops.hpp +++ b/geom/ops.hpp @@ -11,7 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * - * Copyright 2015 Danny Robson + * Copyright 2015-2018 Danny Robson */ #ifndef __UTIL_GEOM_OPS_HPP @@ -20,6 +20,8 @@ #include "./fwd.hpp" #include "../point.hpp" +#include + /////////////////////////////////////////////////////////////////////////////// namespace util::geom { @@ -41,11 +43,17 @@ namespace util::geom { T distance2 (A, B); + // disable distance for point-point arguments given it's already + // explicitly specified in the point header. template < size_t S, typename T, template class A, - template class B + template class B, + typename = std::enable_if_t< + !std::is_same_v, A> && + !std::is_same_v, B> + > > T distance (A, B);