-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL] Add operator overloading for aggregate types in annotated_ref (#…
…11971) Added several operator overloading for aggregate types for annotated_ref class. This https://godbolt.org/z/h5cTTr17K would be a good example to show why this is not working without this fix. This PR includes several changes: 1. Propogate operators including all binaries and unary operators, including arithmetic, comparator, and logical. 2. Using perfecting forwarding for binaries operators, compound operators, and unary operators. This covers cases in which the sequence of conversions will be correct when implicit conversion is involved. i.e ``` annotated_ref<int> a; double b; auto p = a + b; // expected to be (double)a + b, and p should be double ``` without this fix, ``` T operator+(T a) const; annotated_ref<int> a; double b; auto p = a + b; // this become a + (int)b, and p will be int ``` --------- Co-authored-by: Roland Schulz <roland.schulz@intel.com>
- Loading branch information
1 parent
19c17e2
commit 4ab007d
Showing
4 changed files
with
560 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.