Here’s my example:
template<typename TContainer>
class MyClass
{
public:
typedef typename SomeUnknownHelper<TContainer>::iterator iterator;
};
std::vector<int>::iterator i = MyClass<std::vector<int>>::iterator;
int *pi = MyClass<int[20]>::iterator;
Basically, I don’t know how to write SomeUnknownHelper.
I know I could specialize MyClass itself, but in my real-world case it would be a hassle because the class is large.
That’s easily doable with
decltypeandstd::begin:An even better option might be using Boost.Range: