class template constructor overload resolution ambiguity
问题 I'm writing a class template like stl vector,and two constructors are like this: template<class T> vector<T>::vector(size_t count, const T&value) :bg(new T[count]), ed(bg + count), cap(ed) { for (auto it = bg; it != ed; ++it) *it = value; }//bg ed cap are all T* template<class T> template<class Input> vector<T>::vector(Input first, Input second) : bg(new T[second - first]), ed(bg + (second - first)), cap(ed) { memcpy(bg, (void*)first, sizeof(T)*(second - first)); } so if I do this vector<int