From 8636c30d820fa6cd390345c0f3fe333a6e5e1f0d Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Sat, 4 Apr 2026 12:34:21 -0500 Subject: [PATCH] Add converting constructors to multi_ptr for generic address space The generic_space specialization had copy and move operator= overloads that accept a multi_ptr with any non-constant address space, but no matching constructors. This made implicit conversion from a specific address space pointer to generic_ptr impossible in initialization and function call contexts. Added the corresponding copy and move constructors with the same constraints as the existing operator= overloads. --- adoc/chapters/programming_interface.adoc | 22 ++++++++++++++++++++++ adoc/headers/multipointer.h | 12 ++++++++++++ 2 files changed, 34 insertions(+) diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index 6a00a8de5..8a9a09f0f 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -10384,6 +10384,28 @@ multi_ptr(std::nullptr_t) ---- a@ Constructor from a [code]#nullptr#. +a@ +[source] +---- +template +multi_ptr(const multi_ptr&) +---- + a@ Available only when: + [code]#(Space == access::address_space::generic_space && AS != access::address_space::constant_space)#. + +Constructs a [code]#generic_ptr# by copying the value of the right hand side [code]#multi_ptr#. + +a@ +[source] +---- +template +multi_ptr(multi_ptr&&) +---- + a@ Available only when: + [code]#(Space == access::address_space::generic_space && AS != access::address_space::constant_space)#. + +Constructs a [code]#generic_ptr# by moving the value of the right hand side [code]#multi_ptr#. + a@ [source] ---- diff --git a/adoc/headers/multipointer.h b/adoc/headers/multipointer.h index ab960bb0c..a66c6d409 100644 --- a/adoc/headers/multipointer.h +++ b/adoc/headers/multipointer.h @@ -64,6 +64,18 @@ class multi_ptr { typename multi_ptr::pointer); multi_ptr(std::nullptr_t); + // Available only when: + // (Space == access::address_space::generic_space && + // AS != access::address_space::constant_space) + template + multi_ptr(const multi_ptr&); + + // Available only when: + // (Space == access::address_space::generic_space && + // AS != access::address_space::constant_space) + template + multi_ptr(multi_ptr&&); + // Available only when: // (Space == access::address_space::global_space || // Space == access::address_space::generic_space) &&