File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -329,6 +329,11 @@ namespace detail {
329329inline constexpr bool
330330address_space_cast_is_possible (access::address_space Src,
331331 access::address_space Dst) {
332+ // constant_space is unique and is not interchangeable with any other.
333+ auto constant_space = access::address_space::constant_space;
334+ if (Src == constant_space || Dst == constant_space)
335+ return Src == Dst;
336+
332337 auto generic_space = access::address_space::generic_space;
333338 if (Src == Dst || Src == generic_space || Dst == generic_space)
334339 return true ;
@@ -348,7 +353,6 @@ address_space_cast_is_possible(access::address_space Src,
348353 return false ;
349354}
350355
351- // TODO: Should generic <-> constant be allowed?
352356template <access::address_space Space, typename ElementType>
353357auto static_address_cast (ElementType *Ptr) {
354358 constexpr auto generic_space = access::address_space::generic_space;
@@ -394,6 +398,7 @@ auto static_address_cast(ElementType *Ptr) {
394398 }
395399#endif
396400}
401+
397402// Previous implementation (`castAS`, used in `multi_ptr` ctors among other
398403// places), used C-style cast instead of a proper dynamic check for some
399404// backends/spaces. `SupressNotImplementedAssert = true` parameter is emulating
You can’t perform that action at this time.
0 commit comments