Why can't T be deduced in the following?
enum class E
{
e1,
e2
};
template<typename T>
struct container
{
template<E e>
struct iterator {};
template<E e = E::e1>
iterator<e> begin() { return iterator<e>{}; }
};
template<typename T, E e>
void function(typename container<T>::template iterator<e> it)
{
// ...
}
int main()
{
container<int> c;
auto it = c.begin();
function<int>(it); // fine, takes T = int and deduces e
function(it); // "couldn't deduce template parameter T"
}

