Created
July 11, 2023 11:16
-
-
Save NTG-TPL/73f3a114afac750224d31296a97b0614 to your computer and use it in GitHub Desktop.
Function compares all arguments with the first
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Checks if there is an argument equal to the first | |
template<typename T, typename ...Tail> | |
bool EqualsToOneOf(const T &t, const Tail&... tail){ | |
if constexpr (sizeof...(tail) == 0) { | |
return false; | |
}else { | |
return ( (t == tail) || ...); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment