Intel® oneAPI DPC++/C++ Compiler
Developer Guide and Reference
A newer version of this document is available. Customers should click here to go to the newest version.
Proxy
Proxy object provides access to a specific Primitive, Primitive data member, or nested data member within a Primitive for an element in a container.
Description
accessor [index] or a Proxy object’s Data Member Interfaces return Proxy objects. That Proxy object represents the Primitive, Primitive data member, or nested data member within a Primitive for an element in a container. The Proxy object has the following features:
- A value_type can be exported or imported from the Proxy. - Conversion operator is used to export the value_type 
- Alternatively the Proxy can be passed to the function unproxy to export a value_type 
- Assignment operator = is used to import value_type into the Proxy 
 
- Overloads the following operators if the underlying value_type supports the operator - ==, !=, <, >, <=, >=, +, -, *, /, %, &&, ||, &, |, ^, ~, *, +, -, !, +=, -=, *=, /=, %=, >>=, <<=, &=, |=, ^=, ++, -- 
- When an operator is called the following occurs: - value_type is exported 
- The operator applied to the exported value 
- If the operator was an assignment, the result is imported back into the Member and returns the proxy 
- Otherwise a result is returned. 
 
 
- Data Member Interface. - For each data member of value_type - A member access method is defined which returns a Member proxy representing just that member. 
 
 
| Member Type | Description | 
|---|---|
|  | The type of the data the Proxy is representing | 
| Member | Description | 
|---|---|
|  | Returns: exports a copy of the Proxy’s value. NOTE: constant return value prevents rvalue assignment for structs offering some protection against code that expected a modifiable reference. | 
|  | Imports a_value into container at the position the Proxy is representing. Returns: the same constant value_type it was passed. NOTE: This behavior is different from traditional assignment operators that return *this. Choice was to enable efficient chaining of assignment operators versus returning a Proxy which would have to export the value it had just imported. | 
|  | Exports value from the other Proxy and imports it. Returns: A reference to this Proxy obect. | 
|  | Returns: Proxy instance representing the 1st data member of the value_type NOTE: actual method name is the name of the value_type’s 1st data member | 
|  | Returns: Proxy instance representing the 2nd data member of the value_type. NOTE: actual method name is the name of the value_type’s 2nd data member. | 
|  | Returns: Proxy instance representing the ...th data member of the value_type. NOTE: actual method name is the name of the value_type’s …th data member. | 
|  | Returns: Proxy instance representing the Nth data member of the value_type. NOTE: actual method name is the name of the value_type’s Nth data member |