Skip to content

Commit 63c308a

Browse files
committed
error fix
1 parent 0f7df31 commit 63c308a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

modules/xphoto/src/norm2.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ template<class T, T v> struct int_const { // integral_constant
5454
typedef int_const<bool,true> ttype; // true_type
5555
typedef int_const<bool,false> ftype; // false_type
5656

57-
template<class T, class U> struct same_as : ftype {};
58-
template<class T> struct same_as<T, T> : ttype {}; // is_same
59-
57+
template <class T, class U> struct same_as : ftype {};
58+
template <class T> struct same_as<T, T> : ttype {}; // is_same
6059

6160

6261
template <typename _Tp> struct is_norm2_type :
63-
int_const<bool, _Tp(-1) < _Tp(0) && !same_as<_Tp, char>::value> {};
62+
int_const<bool, !same_as<_Tp, char>::value
63+
&& !same_as<_Tp, uchar>::value
64+
&& !same_as<_Tp, ushort>::value
65+
&& !same_as<_Tp, uint>::value>{};
6466

6567
template <typename _Tp, int cn> static inline typename iftype< is_norm2_type<_Tp>::value, _Tp >::
6668
type norm2(cv::Vec<_Tp, cn> a, cv::Vec<_Tp, cn> b) { return (a - b).dot(a - b); }

0 commit comments

Comments
 (0)