Making a SharingPtr out of a nullptr_t should be a safe and allowed operation

llvm-svn: 207129
This commit is contained in:
Enrico Granata 2014-04-24 17:28:09 +00:00
parent 7d2a5e6862
commit 6bfbdc55f8
1 changed files with 9 additions and 0 deletions

View File

@ -138,6 +138,7 @@ private:
struct nat {int for_bool_;};
public:
SharingPtr();
SharingPtr(std::nullptr_t);
template<class Y> explicit SharingPtr(Y* p);
template<class Y> explicit SharingPtr(Y* p, imp::shared_count *ctrl_block);
template<class Y> SharingPtr(const SharingPtr<Y>& r, element_type *p);
@ -191,6 +192,14 @@ SharingPtr<T>::SharingPtr()
cntrl_(0)
{
}
template<class T>
inline
SharingPtr<T>::SharingPtr(std::nullptr_t)
: ptr_(0),
cntrl_(0)
{
}
template<class T>
template<class Y>