Skip to content

Commit 23bb9a5

Browse files
committed
implement a noexcept version of new
1 parent ee42ec1 commit 23bb9a5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/cpp-utility/std/New.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#pragma once
2+
3+
namespace std {
4+
5+
template<class T, class... Args>
6+
T* new_nothrow(Args&&... args) noexcept(noexcept(T(std::forward<Args>(args)...))) {
7+
return new (std::nothrow) T(std::forward<Args>(args)...);
8+
}
9+
10+
} // namespace std

0 commit comments

Comments
 (0)