Re: Assignment of boost::dll::import_symbol to boost::shared_ptr fails to compile

Antony Polukhin via Boost-users <[email protected]> Sat, 14 Jun 2025 10:42:14 +0300
Newsgroups gmane.comp.lib.boost.user
Message-ID <CAKqmYPaETOSd-xJeSXtDDjV=0w0QvJzQ5-U2KY8-HGQQRLPpMg@mail.gmail.com>
--===============8759333744762958060==
Content-Type: multipart/alternative; boundary="000000000000d204430637834dee"

--000000000000d204430637834dee
Content-Type: text/plain; charset="UTF-8"

On Sat, Jun 14, 2025, 07:16 Yuri via Boost-users <
[email protected]> wrote:

> I've encountered the compilation error with this program with
> boost-libs-1.88.0:
>
<...>

> It seems that such assignment should work.
>
Boost.DLL now uses std::shared_ptr. Quoting release notes
https://www.boost.org/releases/1.88.0/ :

> boost::dll:import_* functions now return std::shared_ptr rather than
boost::shared_ptr. Define BOOST_DLL_USE_BOOST_SHARED_PTR to restore the old
behavior, however note that the macro will be removed in one of the
upcomming Boost releases.

So for the above case I'd recommend to use `auto` or switch to
std::shared_ptr.

--000000000000d204430637834dee
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote gmail_quote_contai=
ner"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Jun 14, 2025, 07:16 Yuri=
 via Boost-users &lt;<a href=3D"mailto:[email protected]">boost-u=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
><u></u>

 =20

   =20
 =20
  <div>
    <p>I&#39;ve encountered the compilation error with this program with=C2=
=A0<span style=3D"font-family:monospace"><span style=3D"color:#000000;backg=
round-color:#ffffff">boost-libs-1.88.0</span></span>:</p></div></blockquote=
></div></div><div dir=3D"auto">&lt;...&gt;</div><div dir=3D"auto"><div clas=
s=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    <p><span style=3D"font-family:monospace">It seems that such assignment
        should work.</span><span style=3D"font-family:monospace"><br></span=
></p></blockquote></div></div><div dir=3D"auto">Boost.DLL now uses std::sha=
red_ptr. Quoting release notes <a href=3D"https://www.boost.org/releases/1.=
88.0/">https://www.boost.org/releases/1.88.0/</a> :</div><div dir=3D"auto">=
<br></div><div dir=3D"auto">&gt; boost::dll:import_* functions now return s=
td::shared_ptr rather than boost::shared_ptr. Define BOOST_DLL_USE_BOOST_SH=
ARED_PTR to restore the old behavior, however note that the macro will be r=
emoved in one of the upcomming Boost releases.=C2=A0</div><div dir=3D"auto"=
><br></div><div dir=3D"auto">So for the above case I&#39;d recommend to use=
 `auto` or switch to std::shared_ptr.</div></div>

--000000000000d204430637834dee--

--===============8759333744762958060==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Boost-users mailing list
[email protected]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

--===============8759333744762958060==--