diff --git a/include/memory b/include/memory index 49a53c32..189e3b90 100644 --- a/include/memory +++ b/include/memory @@ -90,7 +90,7 @@ struct allocator_traits template static void destroy(allocator_type& a, T* p); - static size_type max_size(const allocator_type& a); + static size_type max_size(const allocator_type& a); // noexcept in C++14 static allocator_type select_on_container_copy_construction(const allocator_type& a); @@ -1483,7 +1483,7 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits {__destroy(__has_destroy(), __a, __p);} _LIBCPP_INLINE_VISIBILITY - static size_type max_size(const allocator_type& __a) + static size_type max_size(const allocator_type& __a) _NOEXCEPT {return __max_size(__has_max_size(), __a);} _LIBCPP_INLINE_VISIBILITY diff --git a/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp b/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp index 86a36514..1fa72912 100644 --- a/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp +++ b/test/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp @@ -12,7 +12,7 @@ // template // struct allocator_traits // { -// static size_type max_size(const allocator_type& a); +// static size_type max_size(const allocator_type& a) noexcept; // ... // }; @@ -61,4 +61,10 @@ int main() const B b = {}; assert(std::allocator_traits >::max_size(b) == 100); } +#if __cplusplus >= 201103 + { + std::allocator a; + static_assert(noexcept(std::allocator_traits>::max_size(a)) == true, ""); + } +#endif } diff --git a/www/cxx1y_status.html b/www/cxx1y_status.html index 5dbdc125..c9ce2882 100644 --- a/www/cxx1y_status.html +++ b/www/cxx1y_status.html @@ -148,7 +148,7 @@ 2148Hashing enums should be supported directly by std::hashBristol 2149Concerns about 20.8/5Bristol 2162allocator_traits::max_size missing noexceptBristol - 2163nth_element requires inconsistent post-conditionsBristol + 2163nth_element requires inconsistent post-conditionsBristolComplete 2169Missing reset() requirements in unique_ptr specializationBristol 2172Does atomic_compare_exchange_* accept v == nullptr arguments?Bristol 2080Specify when once_flag becomes invalidBristol