Boost logo

Boost :

Subject: Re: [boost] Is there any interest in non-owning pointer-like types?
From: Edward Diener (eldiener_at_[hidden])
Date: 2017-02-09 21:15:51


On 2/9/2017 1:56 PM, Gottlob Frege via Boost wrote:
> Naming:
>
> - I think pointer or reference like things should be named _ptr or
> _ref etc. (In comparison, optional and any can be null, but own their
> value, they don't reference an external value.)

I agree that adding _ptr to something that takes the form of a pointer
is a good idea.

> - 'observer' has already been taken by the Gang of Four as a design
> pattern. Unfortunately. We could re-take the term, but it does add
> confusion.

I see no confusion using a term which has been mentioned as a design
pattern.

> - I've suggested cadged_ptr in the past - it is not a great word, as
> it it not very common, but it is actually the right meaning.

I do not think it is necessary to use a fairly obscure word as opposed
to a more common term, unless that common term is misleading.

> And by not being common, it means we can imbue it with whatever
> meaning we'd like. In that sense it is a perfectly cromulent word.
>
> Tony
>
> On Thu, Feb 9, 2017 at 8:08 AM, Joseph Thomson via Boost
> <boost_at_[hidden]> wrote:
>> On Thu, Feb 2, 2017 at 6:18 AM, Niall Douglas <s_sourceforge_at_[hidden]>
>> wrote:
>>
>>> The GSL is a *much* better home for it than Boost because then you'll
>>> have Bjarne batting for it, plus static checking support from Microsoft
>>> in VS2017 and Google via clang-tidy. You'll also get a *huge* userbase
>>> almost instantly, because the GSL or rather one of its C++ 98 clones is
>>> seeing exponential growth recently. It's amazingly useful for upgrading
>>> ancient C++ codebases.
>>
>>
>> For those who are interested, I have included `observer<T>` (but not
>> `observer_ptr<T>`) as part of a proposal regarding the recommended use of
>> pointers over at the C++ Core Guidelines
>> <https://github.com/isocpp/CppCoreGuidelines>. If you feel so inclined, you
>> can continue the discussion in the issue I created. I have taken on board
>> some of the feedback I received in this thread, so thanks very much.
>>
>> Issue: https://github.com/isocpp/CppCoreGuidelines/issues/847
>> Proposal: https://github.com/hpesoj/gsl-pointers


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk