A.size() = B.size(); is without a doubt illegal. std::vector has a resize() member that can modify the size of the vector.
But, as jonnin said, std::vector already provides a copy constructor and assignment operator that deep-copies the elements.
we see that the operands on both cases are vector<int>::iterator and vector<float>::iterator,
then we reach to the explanation.
Or, as a compiler says:
16:9: error: no match for 'operator=' (operand types are 'std::vector<int>::iterator {aka __gnu_cxx::__normal_iterator<int*, std::vector<int> >}' and 'std::vector<float>::iterator {aka __gnu_cxx::__normal_iterator<float*, std::vector<float> >}')
16:25: error: no match for 'operator!=' (operand types are 'std::vector<int>::iterator {aka __gnu_cxx::__normal_iterator<int*, std::vector<int> >}' and 'std::vector<float>::iterator {aka __gnu_cxx::__normal_iterator<float*, std::vector<float> >}')
Focus on these:
* Where does the (syntax) error occur?
* What is in there?
* What does the compiler tell?