-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change return type of named swizzles
This is change 5 of 9 that fix problems with the specification of the `vec` class. An implementation that follows the existing specification would not accept common code patterns and would not pass the CTS. None of the existing implementations actually follow the existing specification. This change aligns the return type of the 1-element "named" swizzles to the behavior of the existing implementations (and the CTS). This changes the specified behavior of code like this: ``` vec<uint8_t, 4> v4{255}; auto v = v4.x(); // Returns reference to "uint8_t" not 1-element swizzle int i = v4.x() + 1; // Result is 256 not 0 ``` These changes correspond to slides 19 - 22 of the presentation that was discussed in the WG meetings.
- Loading branch information
Showing
2 changed files
with
57 additions
and
45 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