Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #86074

Re: Is it possible to test if a raw pointer is pointing to a valid object?

From "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups comp.lang.c++
Subject Re: Is it possible to test if a raw pointer is pointing to a valid object?
Date 2022-08-25 11:38 -0700
Organization A noiseless patient Spider
Message-ID <te8fja$3n6ps$2@dont-email.me> (permalink)
References <te5lf8$3camt$1@dont-email.me> <te71ur$3j5pf$1@dont-email.me> <7da49ad0-8cff-40c6-8f74-8e891476021en@googlegroups.com>

Show all headers | View raw


On 8/25/2022 3:37 AM, Malcolm McLean wrote:
> On Thursday, 25 August 2022 at 06:39:56 UTC+1, Bonita Montero wrote:
>> Am 24.08.2022 um 19:00 schrieb JiiPee:
>>
>>> Is there any way to check if a raw pointer is pointing to a valid object?
>> What's the practical use of that ?
>>
> When you don't have good communications between the part of the program
> which is deleting an object, and a part which holds a reference to it.
> For example we have a plugin architecture. A plugin can't call another plugin's
> "update pointers" routine when it deletes a shared object. Fortunately the system
> provides an "is_valid" method, so you can guard against objects being deleted
> when it's your turn for the processor.

Sounds like a need for a proper Lifetime Management protocol...

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Is it possible to test if a raw pointer is pointing to a valid object? JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-24 20:00 +0300
  Re: Is it possible to test if a raw pointer is pointing to a valid object? Paavo Helde <eesnimi@osa.pri.ee> - 2022-08-24 20:24 +0300
    Re: Is it possible to test if a raw pointer is pointing to a valid object? Paavo Helde <eesnimi@osa.pri.ee> - 2022-08-24 20:28 +0300
    Re: Is it possible to test if a raw pointer is pointing to a valid object? JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-24 20:39 +0300
    Re: Is it possible to test if a raw pointer is pointing to a valid object? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-24 10:44 -0700
      Re: Is it possible to test if a raw pointer is pointing to a valid object? JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-24 20:51 +0300
        Re: Is it possible to test if a raw pointer is pointing to a valid object? JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-24 20:52 +0300
          Re: Is it possible to test if a raw pointer is pointing to a valid object? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-08-24 11:59 -0700
            Re: Is it possible to test if a raw pointer is pointing to a valid object? Manfred <noname@add.invalid> - 2022-08-26 02:26 +0200
  Re: Is it possible to test if a raw pointer is pointing to a valid object? JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-24 20:41 +0300
    Re: Is it possible to test if a raw pointer is pointing to a valid object? Louis Krupp <lkrupp@invalid.pssw.com.invalid> - 2022-08-24 13:51 -0600
  Re: Is it possible to test if a raw pointer is pointing to a valid object? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-24 12:45 -0700
    Re: Is it possible to test if a raw pointer is pointing to a valid object? JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-24 23:17 +0300
      Re: Is it possible to test if a raw pointer is pointing to a valid object? scott@slp53.sl.home (Scott Lurndal) - 2022-08-24 20:54 +0000
        Re: Is it possible to test if a raw pointer is pointing to a valid object? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-24 14:57 -0700
          Re: Is it possible to test if a raw pointer is pointing to a valid object? Vir Campestris <vir.campestris@invalid.invalid> - 2022-08-25 12:52 +0100
  Re: Is it possible to test if a raw pointer is pointing to a valid         object? Sam <sam@email-scan.com> - 2022-08-24 20:21 -0400
  Re: Is it possible to test if a raw pointer is pointing to a valid object? Bonita Montero <Bonita.Montero@gmail.com> - 2022-08-25 07:39 +0200
    Re: Is it possible to test if a raw pointer is pointing to a valid object? Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2022-08-25 03:37 -0700
      Re: Is it possible to test if a raw pointer is pointing to a valid         object? Sam <sam@email-scan.com> - 2022-08-25 09:37 -0400
      Re: Is it possible to test if a raw pointer is pointing to a valid object? JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-25 17:28 +0300
        Re: Is it possible to test if a raw pointer is pointing to a valid         object? Sam <sam@email-scan.com> - 2022-08-25 19:39 -0400
        Re: Is it possible to test if a raw pointer is pointing to a valid object? Paul N <gw7rib@aol.com> - 2022-08-26 05:49 -0700
          Re: Is it possible to test if a raw pointer is pointing to a valid object? JiiPee <kerrttuPoistaTama11@gmail.com> - 2022-08-26 19:35 +0300
            Re: Is it possible to test if a raw pointer is pointing to a valid object? Louis Krupp <lkrupp@invalid.pssw.com.invalid> - 2022-08-26 12:25 -0600
      Re: Is it possible to test if a raw pointer is pointing to a valid object? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-08-25 11:38 -0700
  Re: Is it possible to test if a raw pointer is pointing to a valid object? Lynn McGuire <lynnmcguire5@gmail.com> - 2022-08-26 16:08 -0500

csiph-web