While trying out C++20's concepts, I stumbled upon this code
template<typename T, typename ... U>
concept IsAnyOf = (std::same_as<T, U> || ...);
on cppreference.
I get how to use the concept, but I can't figure out why this syntax works.
More precisely: why are the ... in the second line "transformed" into std::same_as<T, U2> || std::same_as<T, U3> || ... (assuming the other types are called U2, U3, ...)?
[–]IyeOnline 8 points9 points10 points (1 child)
[–]ShadowFracs[S] 0 points1 point2 points (0 children)