Classミュージック アルバムを扱う があります。artistsとはalbumsですstrings。vectorと呼ばれるトラックのコレクション ( ) もありますcontents。各トラックにはtitleと がありdurationます。
これは私のostream <<です:
ostream& operator<<(ostream& ostr, const Album& a){
ostr << "Album: " << a.getAlbumTitle() << ", ";
ostr << "Artist: " << a.getArtistName() << ", ";
ostr << "Contents: " << a.getContents() << ". "; //error thrown here
return ostr;
}
の<<隣にa.getContents()は下線が引かれ、次のように書かれています。"Error: no operator "<<" matches these operands.
私が見逃していること、または間違っていることは何ですか? このようにベクトルを使用することはできませんか? それとも、Track クラスに欠けているものでしょうか?