Skip to content

Commit b60dd94

Browse files
committed
Made adding const conversion implicit
1 parent c78d609 commit b60dd94

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

multi_ptr-cast/sycl-2.2/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This is problematic on a few levels:
3535
* Only allows static casts
3636
* Allows casting the underlying `A*` pointer to a `B*` pointer
3737
even if the type system forbids it
38-
* Does not handle `const` cases
38+
* Does not handle `const` qualifiers
3939

4040
Therefore, there is a clear need to provide more casting options for the `multi_ptr` class
4141
in order to make the casting safer and easier to use.
@@ -88,8 +88,8 @@ class multi_ptr {
8888
template <typename ElementTypeU>
8989
explicit operator multi_ptr<ElementTypeU, Space>() const;
9090

91-
// Explicit conversion to `multi_ptr<const ElementType, Space>`
92-
explicit operator multi_ptr<const ElementType, Space>() const;
91+
// Implicit conversion to `multi_ptr<const ElementType, Space>`
92+
operator multi_ptr<const ElementType, Space>() const;
9393
};
9494

9595
} // namespace sycl
@@ -101,8 +101,8 @@ the existing explicit conversion to `multi_ptr<void, Space>`.
101101
102102
| Member function | Description |
103103
|-----------------|-------------|
104-
| *`template <typename ElementTypeU> explicit operator multi_ptr<ElementTypeU, Space>() const`* | Performs a static cast of the underlying pointer `ElementType*` to `ElementTypeU*` and returns a new `multi_ptr` instance containing the cast pointer. The address space stays the same. This conversion is only valid if the static cast from `ElementType*` to `ElementTypeU*` is valid. |
105-
| *`explicit operator multi_ptr<const ElementType, Space>() const`* | Performs a static cast of the underlying pointer `ElementType*` to `const ElementType*` and returns a new `multi_ptr` instance containing the cast pointer. The address space stays the same. |
104+
| *`template <typename ElementTypeU> explicit operator multi_ptr<ElementTypeU, Space>() const`* | Performs a static cast of the underlying pointer `ElementType*` to `ElementTypeU*` and returns a new `multi_ptr` instance containing the cast pointer. The address space stays the same. This conversion is only valid if the `static_cast` from `ElementType*` to `ElementTypeU*` is valid. |
105+
| *`operator multi_ptr<const ElementType, Space>() const`* | Performs a static cast of the underlying pointer `ElementType*` to `const ElementType*` and returns a new `multi_ptr` instance containing the cast pointer. The address space stays the same. This conversion is implicit because it is always valid to add a `const` qualifier. |
106106
107107
## Conversion functions
108108

0 commit comments

Comments
 (0)