In the last chapter of my book we implemented a simplified version of the vector class
In the chapter I'm studying now we're implementing a simplified version of the string class ... which uses my version of the vector class (called Vec) to hold chars.
Str(const char* cp) {
std::copy(cp, cp + std::strlen(cp), std::back_inserter(data));
}
template<class In> Str(In b, In e){
std::copy(b, e, std::back_inserter(data));
};
Given this two constructors where data is the name of a Vec<char>
The first constructor gives me a error message saying:
error C2039: 'reference' : is not a member of 'Vec<T>'
but the second one (which also uses back_inserter) doesn't give me this message.
Why is only one of them complaining? that really confused me