forked from boostorg/smart_ptr
Use explicit operator bool when available; add nullptr support to shared_ptr. Refs #4116.
[SVN r81780]
This commit is contained in:
@@ -243,6 +243,30 @@ template<class T> inline bool operator!=(shared_array<T> const & a, shared_array
|
||||
return a.get() != b.get();
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
||||
|
||||
template<class T> inline bool operator==( shared_array<T> const & p, std::nullptr_t ) BOOST_NOEXCEPT
|
||||
{
|
||||
return p.get() == 0;
|
||||
}
|
||||
|
||||
template<class T> inline bool operator==( std::nullptr_t, shared_array<T> const & p ) BOOST_NOEXCEPT
|
||||
{
|
||||
return p.get() == 0;
|
||||
}
|
||||
|
||||
template<class T> inline bool operator!=( shared_array<T> const & p, std::nullptr_t ) BOOST_NOEXCEPT
|
||||
{
|
||||
return p.get() != 0;
|
||||
}
|
||||
|
||||
template<class T> inline bool operator!=( std::nullptr_t, shared_array<T> const & p ) BOOST_NOEXCEPT
|
||||
{
|
||||
return p.get() != 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template<class T> inline bool operator<(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
|
||||
{
|
||||
return std::less<T*>()(a.get(), b.get());
|
||||
|
||||
Reference in New Issue
Block a user