More agressive concept for stl containers
This commit is contained in:
@@ -4,15 +4,17 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <concepts>
|
|
||||||
|
|
||||||
// Check if type is like an STL container
|
// Check if type is like an STL container
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept IsSTLContainer = requires(T t) {
|
concept IsSTLContainer = requires(T t) {
|
||||||
typename T::value_type;
|
typename T::value_type;
|
||||||
|
typename T::iterator;
|
||||||
|
typename T::const_iterator;
|
||||||
// TODO(ogniK): Replace below is std::same_as<void> when MSVC supports it.
|
// TODO(ogniK): Replace below is std::same_as<void> when MSVC supports it.
|
||||||
t.begin();
|
t.begin();
|
||||||
t.end();
|
t.end();
|
||||||
|
t.cbegin();
|
||||||
|
t.cend();
|
||||||
t.data();
|
t.data();
|
||||||
t.size();
|
t.size();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user