Make max_size noexcept

This commit is contained in:
Glen Fernandes
2021-12-04 00:24:45 -05:00
parent c1be2097d7
commit 46f37b2f16

View File

@ -551,7 +551,7 @@ allocator_destroy(A&, T* p)
#if defined(BOOST_NO_CXX11_ALLOCATOR) #if defined(BOOST_NO_CXX11_ALLOCATOR)
template<class A> template<class A>
inline typename allocator_size_type<A>::type inline typename allocator_size_type<A>::type
allocator_max_size(const A& a) allocator_max_size(const A& a) BOOST_NOEXCEPT
{ {
return a.max_size(); return a.max_size();
} }
@ -576,7 +576,7 @@ public:
template<class A> template<class A>
inline typename std::enable_if<detail::alloc_has_max_size<A>::value, inline typename std::enable_if<detail::alloc_has_max_size<A>::value,
typename allocator_size_type<A>::type>::type typename allocator_size_type<A>::type>::type
allocator_max_size(const A& a) allocator_max_size(const A& a) BOOST_NOEXCEPT
{ {
return a.max_size(); return a.max_size();
} }
@ -584,7 +584,7 @@ allocator_max_size(const A& a)
template<class A> template<class A>
inline typename std::enable_if<!detail::alloc_has_max_size<A>::value, inline typename std::enable_if<!detail::alloc_has_max_size<A>::value,
typename allocator_size_type<A>::type>::type typename allocator_size_type<A>::type>::type
allocator_max_size(const A&) allocator_max_size(const A&) BOOST_NOEXCEPT
{ {
return (std::numeric_limits<typename return (std::numeric_limits<typename
allocator_size_type<A>::type>::max)() / sizeof(typename A::value_type); allocator_size_type<A>::type>::max)() / sizeof(typename A::value_type);