summaryrefslogtreecommitdiffstats
path: root/src/common/concepts.h
diff options
context:
space:
mode:
authorMai <mathew1800@gmail.com>2022-10-26 17:12:48 +0200
committerGitHub <noreply@github.com>2022-10-26 17:12:48 +0200
commit041eb5bf57f4db8609341c77bd5d38ddcd8b2d80 (patch)
treef8df340674b1480f3e0f53a9d21b7fa6fbb350f3 /src/common/concepts.h
parentMerge pull request #9128 from abouvier/patch-1 (diff)
parentconcepts: Use the std::contiguous_iterator concept (diff)
downloadyuzu-041eb5bf57f4db8609341c77bd5d38ddcd8b2d80.tar
yuzu-041eb5bf57f4db8609341c77bd5d38ddcd8b2d80.tar.gz
yuzu-041eb5bf57f4db8609341c77bd5d38ddcd8b2d80.tar.bz2
yuzu-041eb5bf57f4db8609341c77bd5d38ddcd8b2d80.tar.lz
yuzu-041eb5bf57f4db8609341c77bd5d38ddcd8b2d80.tar.xz
yuzu-041eb5bf57f4db8609341c77bd5d38ddcd8b2d80.tar.zst
yuzu-041eb5bf57f4db8609341c77bd5d38ddcd8b2d80.zip
Diffstat (limited to 'src/common/concepts.h')
-rw-r--r--src/common/concepts.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/common/concepts.h b/src/common/concepts.h
index e8ce30dfe..a9acff3e7 100644
--- a/src/common/concepts.h
+++ b/src/common/concepts.h
@@ -3,24 +3,14 @@
#pragma once
+#include <iterator>
#include <type_traits>
namespace Common {
-// Check if type is like an STL container
+// Check if type satisfies the ContiguousContainer named requirement.
template <typename T>
-concept IsSTLContainer = requires(T t) {
- typename T::value_type;
- typename T::iterator;
- typename T::const_iterator;
- // TODO(ogniK): Replace below is std::same_as<void> when MSVC supports it.
- t.begin();
- t.end();
- t.cbegin();
- t.cend();
- t.data();
- t.size();
-};
+concept IsContiguousContainer = std::contiguous_iterator<typename T::iterator>;
// TODO: Replace with std::derived_from when the <concepts> header
// is available on all supported platforms.