Document %shared_ptr/%unique_ptr incompatibility

Closes #3025
This commit is contained in:
Olly Betts 2024-09-28 15:02:47 +12:00
parent ab3c31ea86
commit d3507febaa
1 changed files with 8 additions and 1 deletions

View File

@ -1938,7 +1938,9 @@ In order to use <tt>boost::shared_ptr</tt>, the <tt>boost_shared_ptr.i</tt> libr
</div>
<p>
You can only use one of these variants of shared_ptr in your interface file at a time.
You can only use one of these variants of shared_ptr in your interface file at a time
(also SWIG doesn't currently support using both <tt>%shared_ptr(T)</tt> and
<tt>%unique_ptr<T></tt> on the same type <tt>T</tt>).
All three variants must be used in conjunction with the <tt>%shared_ptr(T)</tt> macro,
where <tt>T</tt> is the underlying pointer type equating to usage <tt>shared_ptr&lt;T&gt;</tt>.
The type <tt>T</tt> must be non-primitive.
@ -2174,6 +2176,11 @@ The ownership and move semantics described here can of course be modified if not
by copying and customising the typemaps in the appropriate <tt>std_unique_ptr.i</tt> library file.
</p>
<p>
Note that SWIG doesn't currently support using both <tt>%shared_ptr(T)</tt> and
<tt>%unique_ptr<T></tt> on the same type <tt>T</tt>.
</p>
<H4><a name="Library_std_unique_ptr_by_value">12.5.6.1 unique_ptr passed by value</a></H4>