Re: Template operators
On Apr 7, 11:23 am, Marcel Müller <news.5.ma...@spamgourmet.org>
wrote:
> D-Dog wrote:
> > bool operator==(testFile &val) {
> > return(data == val.data);
>
> > }
>
> The signature is wrong. Use:
>
> bool operator==(const testFile &val) const {
>
> > However, when I do the following
>
> > class testFile2 {
> > private:
>
> > std::vector< testFile<{some-data-type}> > testThis;
>
> > public:
>
> > bool operator==(testFile2 &this_test) {
> > return(testThis == this_test.testThis);
> > }
>
> Same here, but vector depend on correct signature.
>
> Marcel
Won't using a const lead to a "discards qualifier" error when trying
to compile?
|