Skip to content

Commit

Permalink
Consistent use of noexcept/EA_NOEXCEPT in vector (#243)
Browse files Browse the repository at this point in the history
For apps not using exceptions, using noexcept can trigger compilation errors
  • Loading branch information
AntonYudintsev authored and rparolin committed Jan 2, 2019
1 parent c71b3d1 commit e75a74e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/EASTL/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ namespace eastl
using base_type::internalAllocator;

public:
vector() noexcept(noexcept(EASTL_VECTOR_DEFAULT_ALLOCATOR));
explicit vector(const allocator_type& allocator) noexcept;
vector() EA_NOEXCEPT_IF(EA_NOEXCEPT_EXPR(EASTL_VECTOR_DEFAULT_ALLOCATOR));
explicit vector(const allocator_type& allocator) EA_NOEXCEPT;
explicit vector(size_type n, const allocator_type& allocator = EASTL_VECTOR_DEFAULT_ALLOCATOR);
vector(size_type n, const value_type& value, const allocator_type& allocator = EASTL_VECTOR_DEFAULT_ALLOCATOR);
vector(const this_type& x);
vector(const this_type& x, const allocator_type& allocator);
vector(this_type&& x) noexcept;
vector(this_type&& x) EA_NOEXCEPT;
vector(this_type&& x, const allocator_type& allocator);
vector(std::initializer_list<value_type> ilist, const allocator_type& allocator = EASTL_VECTOR_DEFAULT_ALLOCATOR);

Expand Down Expand Up @@ -502,15 +502,15 @@ namespace eastl
///////////////////////////////////////////////////////////////////////

template <typename T, typename Allocator>
inline vector<T, Allocator>::vector() noexcept(noexcept(EASTL_VECTOR_DEFAULT_ALLOCATOR))
inline vector<T, Allocator>::vector() EA_NOEXCEPT_IF(EA_NOEXCEPT_EXPR(EASTL_VECTOR_DEFAULT_ALLOCATOR))
: base_type()
{
// Empty
}


template <typename T, typename Allocator>
inline vector<T, Allocator>::vector(const allocator_type& allocator) noexcept
inline vector<T, Allocator>::vector(const allocator_type& allocator) EA_NOEXCEPT
: base_type(allocator)
{
// Empty
Expand Down Expand Up @@ -552,7 +552,7 @@ namespace eastl


template <typename T, typename Allocator>
inline vector<T, Allocator>::vector(this_type&& x) noexcept
inline vector<T, Allocator>::vector(this_type&& x) EA_NOEXCEPT
: base_type(eastl::move(x.internalAllocator())) // vector requires move-construction of allocator in this case.
{
DoSwap(x);
Expand Down Expand Up @@ -2015,7 +2015,7 @@ namespace eastl


template <typename T, typename Allocator>
inline void swap(vector<T, Allocator>& a, vector<T, Allocator>& b) noexcept(noexcept(a.swap(b)))
inline void swap(vector<T, Allocator>& a, vector<T, Allocator>& b) EA_NOEXCEPT_IF(EA_NOEXCEPT_EXPR(a.swap(b)))
{
a.swap(b);
}
Expand Down

0 comments on commit e75a74e

Please sign in to comment.