Skip to content

Commit 568f77a

Browse files
committed
[SYCL][COMPAT] Improved readability of compare functions in readme
1 parent e4bc02a commit 568f77a

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

sycl/doc/syclcompat/README.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,25 +1297,19 @@ inline float fast_length(const float *a, int len);
12971297
template <typename ValueT>
12981298
inline ValueT length(const ValueT *a, const int len);
12991299

1300+
// The following definition is enabled when BinaryOperation(ValueT, ValueT) returns bool
1301+
// std::enable_if_t<std::is_same_v<std::invoke_result_t<BinaryOperation, ValueT, ValueT>, bool>, bool>
13001302
template <typename ValueT, class BinaryOperation>
1301-
inline std::enable_if_t<
1302-
std::is_same_v<std::invoke_result_t<BinaryOperation, ValueT, ValueT>, bool>,
1303-
bool>
1303+
inline bool
13041304
compare(const ValueT a, const ValueT b, const BinaryOperation binary_op);
1305-
template <typename ValueT>
1306-
inline std::enable_if_t<
1307-
std::is_same_v<std::invoke_result_t<std::not_equal_to<>, ValueT, ValueT>,
1308-
bool>,
1309-
bool>
1310-
compare(const ValueT a, const ValueT b, const std::not_equal_to<> binary_op);
13111305
template <typename ValueT, class BinaryOperation>
13121306
inline std::enable_if_t<ValueT::size() == 2, ValueT>
13131307
compare(const ValueT a, const ValueT b, const BinaryOperation binary_op);
1314-
template <typename ValueT, class BinaryOperation>
1315-
inline std::enable_if_t<
1316-
std::is_same_v<std::invoke_result_t<BinaryOperation, ValueT, ValueT>, bool>,
1317-
bool>
13181308

1309+
// The following definition is enabled when BinaryOperation(ValueT, ValueT) returns bool
1310+
// std::enable_if_t<std::is_same_v<std::invoke_result_t<BinaryOperation, ValueT, ValueT>, bool>, bool>
1311+
template <typename ValueT, class BinaryOperation>
1312+
inline bool
13191313
unordered_compare(const ValueT a, const ValueT b,
13201314
const BinaryOperation binary_op);
13211315
template <typename ValueT, class BinaryOperation>

0 commit comments

Comments
 (0)