I am trying to replace a string in a vector of structs.
struct Song
{
string artist;
string title;
string album;
double m_price;
string year;
size_t length;
};
vector<Song> c_collection;
Then I used this loop to replace a string "[None]" in 'album' with 6 spaces:
for (auto& c : c_collection)
{
std::replace(c.album.begin(), c.album.end(), string("[None]"), string(" "));
}
Compiler shows an error which says:
"cannot convert from 'const_Ty' to 'char' with [ _Ty=std::string ]".
What did i do wrong?