geom/ops: remove point-point distance via sfinae

point-point distance is already defined outside of the geom namespace
This commit is contained in:
Danny Robson 2018-04-16 15:58:13 +10:00
parent a8b3737b8b
commit 87d442772c

View File

@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Copyright 2015 Danny Robson <danny@nerdcruft.net>
* Copyright 2015-2018 Danny Robson <danny@nerdcruft.net>
*/
#ifndef __UTIL_GEOM_OPS_HPP
@ -20,6 +20,8 @@
#include "./fwd.hpp"
#include "../point.hpp"
#include <type_traits>
///////////////////////////////////////////////////////////////////////////////
namespace util::geom {
@ -41,11 +43,17 @@ namespace util::geom {
T
distance2 (A<S,T>, B<S,T>);
// disable distance for point-point arguments given it's already
// explicitly specified in the point header.
template <
size_t S,
typename T,
template <size_t,typename> class A,
template <size_t,typename> class B
template <size_t,typename> class B,
typename = std::enable_if_t<
!std::is_same_v<util::point<S,T>, A> &&
!std::is_same_v<util::point<S,T>, B>
>
>
T
distance (A<S,T>, B<S,T>);