Thank you, I will.

 

From: Peter C++ <peter.cpp@sommerlad.ch>
Sent: Sunday, November 10, 2019 22:49
To: std-proposals@lists.isocpp.org
Cc: Jorg Brown <jorg.brown@gmail.com>; Steve Weinrich <weinrich.steve@gmail.com>
Subject: Re: [std-proposals] non_owned_ptr

 

Take a look at Anthony williams‘ jss::object_ptr. I consider it an improved version of observer_ptr

 

Peter

sent from a mobile device so please excuse strange words due to autocorrection. 

Prof. Peter Sommerlad

peter.Sommerlad@hsr.ch

+41-79-432 23 32



On 11 Nov 2019, at 06:34, Steve Weinrich via Std-Proposals <std-proposals@lists.isocpp.org> wrote:



Well, the inclusion in the extensions is by no means a guarantee of inclusion in a future standard. A quick Google search reveals this view:

 

On Sun, Nov 10, 2019, 22:20 Jorg Brown <jorg.brown@gmail.com> wrote:

> Is it in serious consideration? 

 

Consideration for what?  It's part of Version 2 of the C++ Extensions for Library Fundamentals, ISO/IEC TS 19568:2017.

 

Code such as this currently compiles:

 

#include <experimental/memory>

 

int f() {

  int a = 1;

  std::experimental::observer_ptr<int> op(&a);

  *op += 1;

  return a;

}

 

As can be seen at https://godbolt.org/z/GQFeh4

 

= - = - = - = - =

 

> the current convention of using raw pointers to represent transient pointers.

 

std::span<T, 1> might also fill that need, depending on your application.

 

 

On Sun, Nov 10, 2019 at 9:09 PM Steve Weinrich via Std-Proposals <std-proposals@lists.isocpp.org> wrote:

None. I was not aware of observer_ptr. Is it in serious consideration? 

 

On Sun, Nov 10, 2019, 22:03 Andrew Tomazos <andrewtomazos@gmail.com> wrote:

 

On Mon, Nov 11, 2019 at 1:45 PM Steve Weinrich via Std-Proposals <std-proposals@lists.isocpp.org> wrote:

I was thinking that a non_owned_ptr would be a good std addition. The idea is to formalize the current convention of using raw pointers to represent transient pointers (transient_ptr might be a better name).

 

Aside from a lot of details, it would simply be a template wrapper around a raw pointer. On destruction, the wrapper would do nothing. 

 

This would allow the enforcement of the intended behavior. 

 

What do you all think? 

--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals