I'd like to write a helper function like:

```
template <typename F, typename Range1, typename Range2>
auto helper(const Range1& left, const Range2& right, F&& pred)
{
    using namespace std; // for cbegin/cend and ADL
    return pred(cbegin(left), cend(left), cbegin(right), cend(right));
}

```

It works well for containers:

```
std::vector<int> v1 = {1,2,3,4,5,6};
std::vector<int> v2 = {5,4,3,2,1,6};

std::cout << helper(v1, v2, [](const auto&... args){ return std::is_permutation(args...);}) << std::endl;

```

but it fails to deduce `initializer_list`-s ([example](http://coliru.stacked-crooked.com/a/a7d6418d96a405b8)):

```
std::cout << helper({1,2,3,4,5,6}, {5,4,3,2,1,6}, [](const auto&... args){ return std::is_permutation(args...);}) << std::endl;

```

Is there an idiomatic way to rewrite `helper` so that it deduces both containers and `initializer_list`-s?

I can't come up with anything better than [overloads for all combinations of container and `initializer_list`](http://coliru.stacked-crooked.com/a/aa2483ace5cc094a).