noexcept for <memory>. I've added a few extension noexcept to: allocator_traits<A>::deallocate, allocaate<T>::deallocate, return_temporary_buffer, and default_delete<T>::operator()(T*) const. My rationale was: If a std-dicated noexcept function needs to call another std-defined function, that called function must be noexcept. We're all a little new to noexcept, so things like this are to be expected. Also included fix for broken __is_swappable trait pointed out by Marc Glisse, thanks Marc|. And fixed a test case for is_nothrow_destructible. Destructors are now noexcept by default|

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132261 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2011-05-28 14:41:13 +00:00
parent 10f25d2739
commit 1694d23e23
8 changed files with 456 additions and 320 deletions

View File

@@ -2999,7 +2999,11 @@ struct __invoke_of
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
typename enable_if
<
is_move_constructible<_Tp>::value &&
is_move_assignable<_Tp>::value
>::type
swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value &&
is_nothrow_move_assignable<_Tp>::value)
{
@@ -3021,6 +3025,10 @@ iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
// __swappable
namespace __detail
{
using _STD::swap;
__nat swap(__any, __any);
template <class _Tp>
@@ -3030,9 +3038,11 @@ struct __swappable
static const bool value = !is_same<type, __nat>::value;
};
} // __detail
template <class _Tp>
struct __is_swappable
: public integral_constant<bool, __swappable<_Tp>::value>
: public integral_constant<bool, __detail::__swappable<_Tp>::value>
{
};