C++ operator== doesn’t work but an actual function does [duplicate]
This question already has answers here: Why can I use initializer lists on the right-hand side of operator += but not operator+? (3 answers) Can operators be overloaded for initializer_list literals? [duplicate] (1 answer) Closed 6 hours ago. I got a function: bool equal(int var, std::initializer_list<int> list) { return std::find(list.begin(), list.end(), var) != list.end(); } […]