template<class mapT, class K, class V>
void f(mapT& m, const K& k, const V& v)
{
pair<mapT::iterator, bool> p = m.insert(make_pair(k, v));
}
MSVC 接受此代码,没有错误或警告。标准对此有何规定?在上面的示例中,我们是否允许(可选)、不允许(禁止)或要求(强制)使用 typename 限定 T::iterator?我对 C++03 规则特别感兴趣,尽管如果 11 有任何变化,我很高兴知道。谢谢你。