Skip to content

Commit

Permalink
throw() -> noexcept
Browse files Browse the repository at this point in the history
  • Loading branch information
r-barnes committed Jun 24, 2024
1 parent fdf1fdb commit a2f6b3c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
14 changes: 7 additions & 7 deletions include/oneapi/tbb/memory_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ class memory_pool_allocator {
typedef memory_pool_allocator<U, P> other;
};

explicit memory_pool_allocator(pool_type &pool) throw() : my_pool(&pool) {}
memory_pool_allocator(const memory_pool_allocator& src) throw() : my_pool(src.my_pool) {}
explicit memory_pool_allocator(pool_type &pool) noexcept : my_pool(&pool) {}
memory_pool_allocator(const memory_pool_allocator& src) noexcept : my_pool(src.my_pool) {}
template<typename U>
memory_pool_allocator(const memory_pool_allocator<U,P>& src) throw() : my_pool(src.my_pool) {}
memory_pool_allocator(const memory_pool_allocator<U,P>& src) noexcept : my_pool(src.my_pool) {}

pointer address(reference x) const { return &x; }
const_pointer address(const_reference x) const { return &x; }
Expand All @@ -117,7 +117,7 @@ class memory_pool_allocator {
my_pool->free(p);
}
//! Largest value for which method allocate might succeed.
size_type max_size() const throw() {
size_type max_size() const noexcept {
size_type max = static_cast<size_type>(-1) / sizeof (value_type);
return (max > 0 ? max : 1);
}
Expand Down Expand Up @@ -149,10 +149,10 @@ class memory_pool_allocator<void, P> {
typedef memory_pool_allocator<U, P> other;
};

explicit memory_pool_allocator( pool_type &pool) throw() : my_pool(&pool) {}
memory_pool_allocator( const memory_pool_allocator& src) throw() : my_pool(src.my_pool) {}
explicit memory_pool_allocator( pool_type &pool) noexcept : my_pool(&pool) {}
memory_pool_allocator( const memory_pool_allocator& src) noexcept : my_pool(src.my_pool) {}
template<typename U>
memory_pool_allocator(const memory_pool_allocator<U,P>& src) throw() : my_pool(src.my_pool) {}
memory_pool_allocator(const memory_pool_allocator<U,P>& src) noexcept : my_pool(src.my_pool) {}

protected:
pool_type *my_pool;
Expand Down
4 changes: 2 additions & 2 deletions src/tbbmalloc_proxy/proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@ _expand (by dummy implementation)
??_V@YAXPEAX@Z void * operator new[](unsigned __int64) (intel64)
??3@YAXPEAX@Z operator delete (intel64)
??_V@YAXPEAX@Z operator delete[] (intel64)
??2@YAPAXIABUnothrow_t@std@@@Z void * operator new (size_t sz, const std::nothrow_t&) throw() (optional)
??_U@YAPAXIABUnothrow_t@std@@@Z void * operator new[] (size_t sz, const std::nothrow_t&) throw() (optional)
??2@YAPAXIABUnothrow_t@std@@@Z void * operator new (size_t sz, const std::nothrow_t&) noexcept (optional)
??_U@YAPAXIABUnothrow_t@std@@@Z void * operator new[] (size_t sz, const std::nothrow_t&) noexcept (optional)
and these functions have runtime-specific replacement:
realloc
Expand Down
2 changes: 1 addition & 1 deletion test/common/exception_handling.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class test_exception : public std::exception {
public:
test_exception ( const char* description ) : my_description(description) {}

const char* what() const throw() override { return my_description; }
const char* what() const noexcept override { return my_description; }
};

class solitary_test_exception : public test_exception {
Expand Down
4 changes: 2 additions & 2 deletions test/conformance/conformance_concurrent_hash_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
that concurrent_hash_map uses only the required interface. */
class MyException : public std::bad_alloc {
public:
virtual const char *what() const throw() override { return "out of items limit"; }
virtual ~MyException() throw() {}
virtual const char *what() const noexcept override { return "out of items limit"; }
virtual ~MyException() noexcept {}
};

/** Has tightly controlled interface so that we can verify
Expand Down
4 changes: 2 additions & 2 deletions test/conformance/conformance_concurrent_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,8 @@ void TestConcurrentPushPop() {

class Foo_exception : public std::bad_alloc {
public:
virtual const char *what() const throw() override { return "out of Foo limit"; }
virtual ~Foo_exception() throw() {}
virtual const char *what() const noexcept override { return "out of Foo limit"; }
virtual ~Foo_exception() noexcept {}
};

#if TBB_USE_EXCEPTIONS
Expand Down
3 changes: 1 addition & 2 deletions test/tbb/test_task_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ class test_exception : public std::exception
public:
test_exception ( const char* descr ) : m_strDescription(descr) {}

const char* what() const throw() override { return m_strDescription; }
const char* what() const noexcept override { return m_strDescription; }
};

using TestException = test_exception;
Expand Down Expand Up @@ -1204,4 +1204,3 @@ TEST_CASE("task_handle cannot be scheduled into other task_group of the same con
}

#endif // TBB_USE_EXCEPTIONS

0 comments on commit a2f6b3c

Please sign in to comment.