Skip to content

Modern SharedPtr IsNull

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Smart Pointers › SharedPtr and WeakPtr › IsNull

IsNull

Returns true if the handle owns no object.

Syntax

IsNull( ) as boolean

Examples

#import "std/memory"
using memory

type Node
    as int32 id
end type

dim p as SharedPtr( of Node )
print p.IsNull( )            '' true -- a default-constructed handle owns nothing

p = MakeShared( of Node )( )
print p.IsNull( )            '' false

p.Reset( )
print p.IsNull( )            '' true -- back to owning nothing

Library: SharedPtr and WeakPtr
Category: Smart Pointers
Documented under: Members

Clone this wiki locally