I want to make following code work:
Mylist lst;
vector<int> v = lst;
So I see I need to convert my list into a vector. I tried this code:
vector<int> operator=(vector<int> v, const List & l) {
return v; // more profound stuff later :-)
}
(placed it outside the class). unfortunately Visual Studio throws me: "Error: 'operator=' must be a member function". And I don't get it - what should I do? I can't place this function inside vector class... Can you help me out with that? Thanks!