ENH: refPtr/tmp is_reference() to complement is_pointer() method

STYLE: return nullptr instead of tmp<...>() for failure
This commit is contained in:
Mark Olesen
2022-09-29 10:46:56 +02:00
parent 159a7a5a38
commit 36d7954004
24 changed files with 48 additions and 41 deletions

View File

@ -191,10 +191,13 @@ public:
bool good() const noexcept { return bool(ptr_); }
//- If the stored/referenced content is const
bool is_const() const noexcept { return type_ == CREF; }
bool is_const() const noexcept { return (type_ == CREF); }
//- True if this is a managed pointer (not a reference)
bool is_pointer() const noexcept { return type_ == PTR; }
bool is_pointer() const noexcept { return (type_ == PTR); }
//- True if this is a reference (not a pointer)
bool is_reference() const noexcept { return (type_ != PTR); }
//- True if this is a non-null managed pointer with a unique ref-count
inline bool movable() const noexcept;