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

Re: simple g++-3.0 problem



>   g++ << 3.0 handled the "std" namespace incorrectly and let you get away
> with this.  g++ 3.0 requires that you either declare "using std" or explicitly
> say "std::string getString()".
> 
>    Not looking forward to fixing this in all my own code,

I knew it had to be something silly like this, thanks.  This code works as
expected:

// begin

#include <string>
#include <iostream.h>

using namespace std;

class foo {
public:
  foo(){}
  ~foo(){}

  string getString(){
    return "harhar";
  }
};

int 
main( int argc, char *argv[] ){
  foo *myFoo = new foo();
  cout << myFoo->getString() << endl;
}

// end

Thanks,
	Dale
-- 
Dale E. Martin, Clifton Labs, Inc.
Senior Computer Engineer
dmartin@cliftonlabs.com
http://www.cliftonlabs.com
pgp key available



Reply to: