Skip to content

vlc_shared_data_ptr: accept implicit ctor for null

Romain Vimont requested to merge rom1v/vlc:vlc_shared_data_ptr into master

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 */

Merge request reports

Loading