J
jalkadir
I my program I have overloaded the inserters and extractor operator.
---name.hpp
friend std:stream& std:perator<<( std:stream& os,
const jme::Name& obj );
friend std::istream& std:perator>>( std::istream& is,
jme::Name& obj );
---name.cpp
std:stream& std:perator<<( std:stream& os, const jme::Name& obj )
{
return os << obj.str;
}
std::istream& std:perator>>( std::istream& is, jme::Name& obj ) {
return is >> obj.str;
}
------------------------
But this gives me an error that reads
Project : Name
Compiler : GNU GCC Compiler (called directly)
Directory : ..\dev\c++\jme\name\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
In file included from main.cpp:3:
name.hpp:83: error: `std:stream& std:perator<<(std:stream&, const
jme::Name&)' should have been declared inside `std'
name.hpp:85: error: `std::istream& std:perator>>(std::istream&,
jme::Name&)' should have been declared inside `std'
Process terminated with status 1 (0 minutes, 5 seconds)
---------------------
What am I doing wrong?
TIA
---name.hpp
friend std:stream& std:perator<<( std:stream& os,
const jme::Name& obj );
friend std::istream& std:perator>>( std::istream& is,
jme::Name& obj );
---name.cpp
std:stream& std:perator<<( std:stream& os, const jme::Name& obj )
{
return os << obj.str;
}
std::istream& std:perator>>( std::istream& is, jme::Name& obj ) {
return is >> obj.str;
}
------------------------
But this gives me an error that reads
Project : Name
Compiler : GNU GCC Compiler (called directly)
Directory : ..\dev\c++\jme\name\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
In file included from main.cpp:3:
name.hpp:83: error: `std:stream& std:perator<<(std:stream&, const
jme::Name&)' should have been declared inside `std'
name.hpp:85: error: `std::istream& std:perator>>(std::istream&,
jme::Name&)' should have been declared inside `std'
Process terminated with status 1 (0 minutes, 5 seconds)
---------------------
What am I doing wrong?
TIA