Skip to content
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

Clarify "vec" ADL behavior #671

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions adoc/chapters/programming_interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18564,6 +18564,23 @@ The constant [code]#NumElements# represents the number of elements in the result
of the swizzle operation, which could be different from the number of elements
in the underlying [code]#vec#.

Because the template parameters to the [code]#+__writeable_swizzle__+# and
[code]#+__const_swizzle__+# classes affect the {cpp} argument dependent lookup
(ADL) behavior, implementations do not have complete freedom when choosing these
template parameters.
Implementations must choose template parameters that result in the following ADL
behavior:

* When an argument is the [code]#+__writeable_swizzle__+# type, the ADL search
set must include only the class template definition for
[code]#+__writeable_swizzle__+#, the class definition for [code]#DataT# (if it
is a class), and the namespaces that contain these types.

* When an argument is the [code]#+__const_swizzle__+# type, the ADL search set
must include only the class template definition for
[code]#+__const_swizzle__+#, the class definition for [code]#DataT# (if it is
a class), and the namespaces that contain these types.

When the string [code]#+__writeable_swizzle__+# or [code]#+__const_swizzle__+#
is used inside the class definition in the synopses below, it refers to the
instantiation with the same set of template parameters as the enclosing class.
Expand Down
Loading