Skip to content

Commit d642db3

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 60dc719 commit d642db3

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
@@ -304,7 +304,8 @@ class UrReturnHelper {
304304

305305
// Array return value where element type is differrent from T
306306
template <class RetType, class T>
307-
ur_result_t operator()(const T *t, size_t s) {
307+
std::enable_if_t<!std::is_same_v<RetType, T>, ur_result_t>
308+
operator()(const T *t, size_t s) {
308309
return ur::getInfoArray<T, RetType>(s, param_value_size, param_value,
309310
param_value_size_ret, t);
310311
}

0 commit comments

Comments
 (0)