-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return types of logical_and
and logical_or
don't match ISO C++
#646
Comments
Agree. Do we need to be carefull with vec / marry
or it will be cover by https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:marray.type tranciantly? |
I think the Maybe the thing to do is convert the whole of Section 4.17.1 to the new style, and explicitly add the necessary specialization: template <typename T = void>
struct logical_and {
bool operator()(const T& x, const T& y) const;
};
template <>
struct logical_and<void> {
template <class T, class U>
constexpr auto operator()(T&& t, U&& u) const -> decltype(std::forward<T>(t) && std::forward<U>(u));
}; We could add explicit overloads for |
I agree with @Pennycook that returning We also shouldn't add explicit overloads for |
SYCL defines these function objects as:
Whereas ISO C++ defines them both as returning
bool
.bool
makes a lot more sense to me thanT
, because the operators are defined as returningx && y
andx || y
.I suspect this is a bug that arose from copying and pasting other function object definitions, but before writing up the fix I wanted to check whether anybody knew of a reason that things should be defined this way.
The text was updated successfully, but these errors were encountered: