[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

jme::io_base outfile;

From: ArbolOne
Subject: jme::io_base outfile;
Date: Sat, 8 Jan 2011 14:42:32 -0800 (PST)
User-agent: G2/1.0

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;
    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

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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]