More agressive concept for stl containers

This commit is contained in:
David Marcec
2020-08-03 17:56:24 +10:00
parent 31b05ae92b
commit 296956cacc

View File

@@ -4,15 +4,17 @@
#pragma once
#include <concepts>
// Check if type is like an STL container
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();
};