Make default constructors constexpr

This commit is contained in:
Peter Dimov
2017-06-18 02:43:20 +03:00
parent 2e469dd7f3
commit 0e78e219f5
7 changed files with 135 additions and 8 deletions

View File

@@ -54,7 +54,7 @@ namespace boost
namespace movelib
{
template< class T, class D > class unique_ptr;
template< class T, class D > class unique_ptr;
} // namespace movelib
@@ -118,7 +118,7 @@ private:
public:
shared_count(): pi_(0) // nothrow
BOOST_CONSTEXPR shared_count(): pi_(0) // nothrow
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(shared_count_id)
#endif
@@ -517,7 +517,7 @@ private:
public:
weak_count(): pi_(0) // nothrow
BOOST_CONSTEXPR weak_count(): pi_(0) // nothrow
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(weak_count_id)
#endif

View File

@@ -26,11 +26,11 @@ template<class T> class enable_shared_from_this
{
protected:
enable_shared_from_this() BOOST_SP_NOEXCEPT
BOOST_CONSTEXPR enable_shared_from_this() BOOST_SP_NOEXCEPT
{
}
enable_shared_from_this(enable_shared_from_this const &) BOOST_SP_NOEXCEPT
BOOST_CONSTEXPR enable_shared_from_this(enable_shared_from_this const &) BOOST_SP_NOEXCEPT
{
}

View File

@@ -345,13 +345,13 @@ public:
typedef typename boost::detail::sp_element< T >::type element_type;
shared_ptr() BOOST_SP_NOEXCEPT : px( 0 ), pn()
BOOST_CONSTEXPR shared_ptr() BOOST_SP_NOEXCEPT : px( 0 ), pn()
{
}
#if !defined( BOOST_NO_CXX11_NULLPTR )
shared_ptr( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn()
BOOST_CONSTEXPR shared_ptr( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn()
{
}

View File

@@ -32,7 +32,7 @@ public:
typedef typename boost::detail::sp_element< T >::type element_type;
weak_ptr() BOOST_SP_NOEXCEPT : px(0), pn()
BOOST_CONSTEXPR weak_ptr() BOOST_SP_NOEXCEPT : px(0), pn()
{
}