Skip to content

Commit 5f11b49

Browse files
committed
Avoid potential ambiguity in UrReturnHelper
If UrReturnHelper's operator() is explicitly called as operator()<T>(...), there is a potential for ambiguity when the specified RetType and the inferred T are the same: this is ambiguous with the version of operator() where only T is a template parameter, and T is specified explicitly. We already have code that explicitly calls operator()<T>(...), so prevent this from becoming a problem.
1 parent a9c7aef commit 5f11b49

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/ur/ur.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ class UrReturnHelper {
302302

303303
// Array return value where element type is differrent from T
304304
template <class RetType, class T>
305-
ur_result_t operator()(const T *t, size_t s) {
305+
typename std::enable_if<!std::is_same<RetType, T>::value, ur_result_t>::type
306+
operator()(const T *t, size_t s) {
306307
return ur::getInfoArray<T, RetType>(s, param_value_size, param_value,
307308
param_value_size_ret, t);
308309
}

0 commit comments

Comments
 (0)