Hey kids, I know that you will be able to spot the mistake and that it
would sound stupid to you, but I am tired and I cannot find where the
problem lies. The code bellow was working when using MinGW-32bit, but
now that I have upgraded to MinGW-64bit... I am having problems. No!,
wait, I think the problem started before the 64bit. Anyhow, it does
not matter, the point is that is giving me trouble.
Bellow is the snip of the hpp, cpp and the main.cpp of the program

hpp file
~~~~~~
class io_base{
.....
virtual io_base& operator<<( bool& )  throw ( some exception );
};

cpp file
~~~~~~
// input data
io_base& io_base::operator<<( bool& data )
throw ( some exception  ) {
  bla, bla, bla.

  return *this;
}
main.cpp
~~~~~~~
    bool tstingb = false;
    io_base infile;
    .... open an existing file for writing into it and then .....
    //inset the value of 'tstingb' into the file stream
    infile << tstingb << endl; // <<<----- Here is where the compiler
gets a crack out of me

COMPILER
~~~~~~~~~
===
error: no match for 'operator<<' in
'infile.io_base::operator<<(((bool&)(& tstingb))) << std::endl'
===
That part is not so confusing as it is the note from the compiler that
follows that statement:
====
note: candidates are: virtual io_base& io_base::operator<<(bool&)
====
That message is disconcerting; because I AM passing a boolean variable
to the overloaded operator.


What am I doing wrong?
Any body?
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to