You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There was much disagreement on the future of std::observer_ptr<T> during the WG21 Cologne meeting this summer (objection against moving it into the standard, but no consensus for dropping it from the library fundamentals TS3). So maybe Boost is the right place for this handy little utility.
What are your thoughts? Would you accept a PR adding observer_ptr<T> to Boost.SmartPtr?
@bernhardmgruber You can propose observer_ptr as a new Boost library too. fixed_string is going this route instead of going into Boost.Container. The same for span.
@pdimov The name has been bikesheded to death by WG21 during the years and observer_ptr<T> was the best they got. I don't want to reopen the discussion, because I feel less qualified to pick a better name ;) @glenfe Would you prefer having observer_ptr<T> in its own library? I thought that going the way through an existing library might be easier than sending an entire new one through the review process.
Users have that preference now-a-days, to be able to pull in small independent components without dependencies on other Boost libraries.
The other advantage is that the facility will receive a Boost review. It had a WG21 review, but (speaking as a WG21 and C++ Standard committee member) a Boost review is worth it.
POLLS
Drop observer_ptr from the TS.
SF F N A SA
7 9 7 7 4
Move observer_ptr to Annex D of the standard (deprecated).
SF F N A SA
5 6 5 13 6
Move observer_ptr toward the WD, no special policy.
SF F N A SA
2 4 4 14 12
Move observer_ptr toward the WD, with LEWG policy to ignore it in the standard.
SF F N A SA
4 8 9 5 9
Actually no, I take that back. There are some parts of the design that I'd change. The pointer constructor should be implicit; there shouldn't be a conversion to a raw pointer; and, arguably, shared_ptr should be implicitly convertible to observer_ptr.
My colleague @MFHava and me finally found some time to put together a simple implementation with some documentation. Most of it is taken quite directly from the working draft. I talked to Walter E. Brown during the last WG21 meeting in Cologne and he was fine with letting us try to publish his work as a boost library.
Activity
pdimov commentedon Oct 6, 2019
Possibly, but I'm not convinced that
observer_ptris the right name. :-)glenfe commentedon Oct 6, 2019
@bernhardmgruber You can propose
observer_ptras a new Boost library too.fixed_stringis going this route instead of going into Boost.Container. The same forspan.bernhardmgruber commentedon Oct 6, 2019
@pdimov The name has been bikesheded to death by WG21 during the years and
observer_ptr<T>was the best they got. I don't want to reopen the discussion, because I feel less qualified to pick a better name ;)@glenfe Would you prefer having
observer_ptr<T>in its own library? I thought that going the way through an existing library might be easier than sending an entire new one through the review process.glenfe commentedon Oct 6, 2019
Users have that preference now-a-days, to be able to pull in small independent components without dependencies on other Boost libraries.
The other advantage is that the facility will receive a Boost review. It had a WG21 review, but (speaking as a WG21 and C++ Standard committee member) a Boost review is worth it.
pdimov commentedon Oct 6, 2019
I don't see much to review there. Except the name. That part of the review will be fun. :-)
pdimov commentedon Oct 6, 2019
Not very encouraging.
glenfe commentedon Oct 6, 2019
Should be an easy review then. :)
pdimov commentedon Oct 6, 2019
Actually no, I take that back. There are some parts of the design that I'd change. The pointer constructor should be implicit; there shouldn't be a conversion to a raw pointer; and, arguably,
shared_ptrshould be implicitly convertible toobserver_ptr.bernhardmgruber commentedon Nov 1, 2019
My colleague @MFHava and me finally found some time to put together a simple implementation with some documentation. Most of it is taken quite directly from the working draft. I talked to Walter E. Brown during the last WG21 meeting in Cologne and he was fine with letting us try to publish his work as a boost library.
The repository is here: https://github.com/MFHava/observer_ptr
How would you recommend to proceed now? I guess there will be a lot to polish before we can start an actual boost review, whatever that means.
glenfe commentedon Nov 1, 2019
Some links: