[smart_ptr][intrusive] boost::unique_ptr<>
Hi, I remember that there was plans to release an "official" STD-conformant implementation of boost::unique_ptr<>. I found: http://boost.2283326.n4.nabble.com/unique-ptr-for-C-03-td4650231.html http://boost.2283326.n4.nabble.com/C-03-unique-ptr-emulation-td2658449.html Do someone know what's the outcome of this initiative? Regards, Adam
On Thu, May 29, 2014 at 9:19 AM, Adam Wulkiewicz wrote:
Hi,
I remember that there was plans to release an "official" STD-conformant implementation of boost::unique_ptr<>. I found: http://boost.2283326.n4.nabble.com/unique-ptr-for-C-03-td4650231.html http://boost.2283326.n4.nabble.com/C-03-unique-ptr-emulation-td2658449.html
Though both threads are about a C++03 emulation of unique_ptr, I wonder if it is worth providing a boost::unique_ptr for C++ implementations still in use that support enough of C++11 r-value references but ship with a broken, or non-conforming, std::unique_ptr implementation. [Such as VC10 and VC11 whose std::unique_ptr has a broken reset() or whose std::unique_ptr has a broken conversion to bool when a different deleter type is specified. I believe there are a few bugs reported about VC12's std::unique_ptr but I haven't looked into them.] Glen
2014-05-30 3:08 GMT+02:00 Glen Fernandes
On Thu, May 29, 2014 at 9:19 AM, Adam Wulkiewicz wrote:
Hi,
I remember that there was plans to release an "official" STD-conformant implementation of boost::unique_ptr<>. I found: http://boost.2283326.n4.nabble.com/unique-ptr-for-C-03-td4650231.html
http://boost.2283326.n4.nabble.com/C-03-unique-ptr-emulation-td2658449.html
Though both threads are about a C++03 emulation of unique_ptr, I wonder if it is worth providing a boost::unique_ptr for C++ implementations still in use that support enough of C++11 r-value references but ship with a broken, or non-conforming, std::unique_ptr implementation.
[Such as VC10 and VC11 whose std::unique_ptr has a broken reset() or whose std::unique_ptr has a broken conversion to bool when a different deleter type is specified. I believe there are a few bugs reported about VC12's std::unique_ptr but I haven't looked into them.]
Actually I had both in mind. If r-val refs were supported it should be STD-conformant implementation, if not, the emulation e.g. using Boost.Move. Plus boost::make_unique() using r-val refs and variadic templates if they were supported or emulating them e.g. using Move and Preprocessor. Someone could say that we should move forward and use C++11/14 but the reality is that many projects are bound to some old compiler versions. Regards, Adam
On Thu, May 29, 2014 at 7:03 PM, Adam Wulkiewicz wrote:
2014-05-30 3:08 GMT+02:00 Glen Fernandes
: Though both threads are about a C++03 emulation of unique_ptr, I wonder if it is worth providing a boost::unique_ptr for C++ implementations still in use that support enough of C++11 r-value references but ship with a broken, or non-conforming, std::unique_ptr implementation.
Actually I had both in mind. If r-val refs were supported it should be STD-conformant implementation, if not, the emulation e.g. using Boost.Move. Plus boost::make_unique() using r-val refs and variadic templates if they were supported or emulating them e.g. using Move and Preprocessor.
*Nod*. I can see the value in that. Glen
[Glen Fernandes]
[Such as VC10 and VC11 whose std::unique_ptr has a broken reset() or whose std::unique_ptr has a broken conversion to bool when a different deleter type is specified. I believe there are a few bugs reported about VC12's std::unique_ptr but I haven't looked into them.]
I am not aware of any bugs in 2013's unique_ptr, except for its empty deleter optimization (I have local changes to make this conformant for the next major version), and specification/implementation issues in shared_ptr(unique_ptr). STL
On Thu, May 29, 2014 at 7:32 PM, Stephan T. Lavavej
[Glen Fernandes]
[Such as VC10 and VC11 whose std::unique_ptr has a broken reset() or whose std::unique_ptr has a broken conversion to bool when a different deleter type is specified. I believe there are a few bugs reported about VC12's std::unique_ptr but I haven't looked into them.]
I am not aware of any bugs in 2013's unique_ptr, except for its empty deleter optimization (I have local changes to make this conformant for the next major version), and specification/implementation issues in shared_ptr(unique_ptr).
I was informed lately only that there are issues related to unique_ptr filed recently (2014) on Connect; I haven't looked into them, so I don't know if the are related to the specification/implementation issues or the deleter issue that you're referring to. Glen
On 29.05.2014 18:19, Adam Wulkiewicz wrote:
Hi,
I remember that there was plans to release an "official" STD-conformant implementation of boost::unique_ptr<>. I found: http://boost.2283326.n4.nabble.com/unique-ptr-for-C-03-td4650231.html http://boost.2283326.n4.nabble.com/C-03-unique-ptr-emulation-td2658449.html
Do someone know what's the outcome of this initiative?
Regards, Adam
Adam, I've been monitoring this list for any progress with this but apparently nothing has happened. In my professional work I use boost::interprocess::unique_ptr with success and this is what I would recommend to you. Maybe it's not that standard-conformant but it suites my needs. Nevertheless, I'd love to see an "official" boost::unique_ptr, especially for C++03 (which is my case). WBR, Adam Romanek
participants (4)
-
Adam Romanek
-
Adam Wulkiewicz
-
Glen Fernandes
-
Stephan T. Lavavej