Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 1
    Please define "valid." Commented Jun 19, 2013 at 22:41
  • 3
    Precisely what smart pointers are good for. Commented Jun 19, 2013 at 22:46
  • if you know how the underlying memory manager works (how it does its book keeping), then you could perhaps figure it out. However, this would be very platform specific. If you manage memory by yourself, then that should not be a problem. The best course of action is still to stick to best practices (RAII, encapsulation). Commented Jun 19, 2013 at 23:48
  • @chris - sort of what smart pointers are good for. But GIGO still applies; you can always create smart pointer that holds a bad pointer. Commented Jun 20, 2013 at 11:18
  • 2
    Possible duplicate of Testing pointers for validity (C/C++) Commented Jun 13, 2016 at 21:02