#include <vector>
template<class T, class F>
auto f(std::vector<T> v, F fun) -> decltype(bool(fun(v[0])), void())
{
// ...
}
int main(){
std::vector<int> v;
f(v, [](int){ return true; });
}
I2luY2x1ZGUgPHZlY3Rvcj4KCnRlbXBsYXRlPGNsYXNzIFQsIGNsYXNzIEY+CmF1dG8gZihzdGQ6OnZlY3RvcjxUPiB2LCBGIGZ1bikgLT4gZGVjbHR5cGUoYm9vbChmdW4odlswXSkpLCB2b2lkKCkpCnsKICAvLyAuLi4KfQoKaW50IG1haW4oKXsKICBzdGQ6OnZlY3RvcjxpbnQ+IHY7CiAgZih2LCBbXShpbnQpeyByZXR1cm4gdHJ1ZTsgfSk7Cn0=