Tests for Ord method

This commit is contained in:
Leonetienne
2022-02-27 14:32:09 +01:00
parent f776f48e21
commit 0886aa0a68
2 changed files with 38 additions and 3 deletions

View File

@@ -9,14 +9,14 @@ public:
template <typename T_Type, class T_Container>
static int Ord(const T_Type& item, const T_Container& set);
private:
// No instanciation! >:(
// No instantiation! >:(
GeneralUtility();
};
template<typename T_Type, class T_Container>
int GeneralUtility::Ord(const T_Type &item, const T_Container& set) {
int GeneralUtility::Ord(const T_Type& item, const T_Container& set) {
const auto result =
std::find_if(set.begin(), set.end(), [item](const char c) -> bool {
std::find_if(set.begin(), set.end(), [item](const T_Type& c) -> bool {
return c == item;
});