Skip to content

Commit 935d246

Browse files
committed
added nodiscard attribute to std::make_unique()
1 parent 8a06436 commit 935d246

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libcxx/include/memory

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,15 +566,15 @@ class bad_weak_ptr
566566
};
567567
568568
template<class T, class... Args>
569-
constexpr unique_ptr<T> make_unique(Args&&... args); // C++14, constexpr since C++23
569+
[[nodiscard]] constexpr unique_ptr<T> make_unique(Args&&... args); // C++14, constexpr since C++23
570570
template<class T>
571-
constexpr unique_ptr<T> make_unique(size_t n); // C++14, constexpr since C++23
571+
[[nodiscard]] constexpr unique_ptr<T> make_unique(size_t n); // C++14, constexpr since C++23
572572
template<class T, class... Args> unspecified make_unique(Args&&...) = delete; // C++14, T == U[N]
573573
574574
template<class T>
575-
constexpr unique_ptr<T> make_unique_for_overwrite(); // T is not array, C++20, constexpr since C++23
575+
[[nodiscard]] constexpr unique_ptr<T> make_unique_for_overwrite(); // T is not array, C++20, constexpr since C++23
576576
template<class T>
577-
constexpr unique_ptr<T> make_unique_for_overwrite(size_t n); // T is U[], C++20, constexpr since C++23
577+
[[nodiscard]] constexpr unique_ptr<T> make_unique_for_overwrite(size_t n); // T is U[], C++20, constexpr since C++23
578578
template<class T, class... Args>
579579
unspecified make_unique_for_overwrite(Args&&...) = delete; // T is U[N], C++20
580580

0 commit comments

Comments
 (0)