#ifndef GENERALUTILITY_GENERALUTILITY_H #define GENERALUTILITY_GENERALUTILITY_H #include #include class GeneralUtility { public: template static int Ord(const T_Type& item, const T_Container& set); private: // No instantiation! >:( GeneralUtility(); }; template int GeneralUtility::Ord(const T_Type& item, const T_Container& set) { const auto result = std::find_if(set.begin(), set.end(), [item](const T_Type& c) -> bool { return c == item; }); // No item found if (result == set.end()) return -1; else return result - set.begin(); } #endif //GENERALUTILITY_GENERALUTILITY_H