mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
IntrusivePtr: move nullptr initializer to field declaration
This allows "defaulting" the default constructor, and guarantees that all constructors really initialize the field to a legal value.
This commit is contained in:
parent
a20dd12117
commit
edb93d1733
1 changed files with 2 additions and 5 deletions
|
@ -44,10 +44,7 @@ public:
|
|||
|
||||
// -- constructors, destructors, and assignment operators
|
||||
|
||||
constexpr IntrusivePtr() noexcept : ptr_(nullptr)
|
||||
{
|
||||
// nop
|
||||
}
|
||||
constexpr IntrusivePtr() noexcept = default;
|
||||
|
||||
constexpr IntrusivePtr(std::nullptr_t) noexcept : IntrusivePtr()
|
||||
{
|
||||
|
@ -160,7 +157,7 @@ private:
|
|||
Ref(raw_ptr);
|
||||
}
|
||||
|
||||
pointer ptr_;
|
||||
pointer ptr_ = nullptr;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue