diff --git a/modcc/modccutil.hpp b/modcc/modccutil.hpp index 80c90d9fc265a9ee0ed86383da919b37da49f352..fde6828c5ea42d40e7b47ec62f742719c7eb35b7 100644 --- a/modcc/modccutil.hpp +++ b/modcc/modccutil.hpp @@ -4,6 +4,7 @@ #include <memory> #include <sstream> #include <vector> +#include <initializer_list> // is thing in list? template <typename T, int N> @@ -16,6 +17,16 @@ bool is_in(T thing, const T (&list)[N]) { return false; } +template <typename T> +bool is_in(T thing, const std::initializer_list<T> list) { + for(auto const& item : list) { + if(thing==item) { + return true; + } + } + return false; +} + inline std::string pprintf(const char *s) { std::string errstring; while(*s) {