partial specialization for iterator type of a specified container type

℡╲_俬逩灬. 提交于 2019-12-04 11:58:35

You can't deduce types left of a nesting ::. Indeed, your question makes no sense. Consider this simpler counter-example:

template <typename> struct Foo;
template <> struct Foo<bool> { typedef float type; };
template <> struct Foo<char> { typedef float type; };

template <typename> struct DoesntWork;

template <typename T> struct DoesntWork<typename Foo<T>::type> { };

Now if I say DoesntWork<float>, what should T be?

The point is that there is no reason that any T should exist for which Foo<T>::type is a thing you want to match, and even if there were one, there's no reason why it would be unique.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!