summaryrefslogtreecommitdiff
path: root/src/common/make_unique_for_overwrite.h
diff options
context:
space:
mode:
authorGravatar Morph2023-01-29 19:52:38 -0500
committerGravatar GitHub2023-01-29 19:52:38 -0500
commit5f4647df7da58aa22be21dd26cfa6de7c5f106c9 (patch)
tree4bbcaee76bde35ddc6eff9a1c639866cf278b353 /src/common/make_unique_for_overwrite.h
parentMerge pull request #9699 from ameerj/texture-pass-desc (diff)
parentMove to Clang Format 15 (diff)
downloadyuzu-5f4647df7da58aa22be21dd26cfa6de7c5f106c9.tar.gz
yuzu-5f4647df7da58aa22be21dd26cfa6de7c5f106c9.tar.xz
yuzu-5f4647df7da58aa22be21dd26cfa6de7c5f106c9.zip
Merge pull request #9705 from behunin/patch-1
Move to Clang Format 15
Diffstat (limited to 'src/common/make_unique_for_overwrite.h')
-rw-r--r--src/common/make_unique_for_overwrite.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/make_unique_for_overwrite.h b/src/common/make_unique_for_overwrite.h
index c7413cf51..17f81bba4 100644
--- a/src/common/make_unique_for_overwrite.h
+++ b/src/common/make_unique_for_overwrite.h
@@ -9,17 +9,19 @@
9namespace Common { 9namespace Common {
10 10
11template <class T> 11template <class T>
12requires(!std::is_array_v<T>) std::unique_ptr<T> make_unique_for_overwrite() { 12 requires(!std::is_array_v<T>)
13std::unique_ptr<T> make_unique_for_overwrite() {
13 return std::unique_ptr<T>(new T); 14 return std::unique_ptr<T>(new T);
14} 15}
15 16
16template <class T> 17template <class T>
17requires std::is_unbounded_array_v<T> std::unique_ptr<T> make_unique_for_overwrite(std::size_t n) { 18 requires std::is_unbounded_array_v<T>
19std::unique_ptr<T> make_unique_for_overwrite(std::size_t n) {
18 return std::unique_ptr<T>(new std::remove_extent_t<T>[n]); 20 return std::unique_ptr<T>(new std::remove_extent_t<T>[n]);
19} 21}
20 22
21template <class T, class... Args> 23template <class T, class... Args>
22requires std::is_bounded_array_v<T> 24 requires std::is_bounded_array_v<T>
23void make_unique_for_overwrite(Args&&...) = delete; 25void make_unique_for_overwrite(Args&&...) = delete;
24 26
25} // namespace Common 27} // namespace Common