Browse Source
The main constructor, accepting a pointer, is explicit:
my_ptr_type *p = ...;
MySharedPtr ptr = p; /* invalid */
MySharedPtr ptr{ p }; /* ok */
This prevents to mistakenly assign a pointer to a shared pointer.
However, assignment to nullptr should be acceptable:
MySharedPtr ptr = nullptr; /* should be ok */
pull/141/head
committed by
Steve Lhomme
1 changed files with 5 additions and 0 deletions
Loading…
Reference in new issue