Fold expressions must be enclosed in (...)
: return ((ts == value) || ... || (false));
.
Also you can drop || false
, it's implicit for ||
folds.
Also I would like to get rid of specifying the type if possible (e.g. the
<int>
)
You can do this by replacing <typename T, T ...ts>
with e.g. <auto ...ts, typename T>
.
But if I was you, I'd pass all alternatives as function parameters (to allow them to be changed at runtime).