Discovered a g++ compiler bug that can be reproduced on (gcc 4.1.2 default instalation on RH5, and gcc 4.3.5).
Given the following code:
template
class Wrapper
{
public: Wrapper( Wrapped *c );
Wrapped *c;
};
class Stream
{
public:
Stream(const Wrapper
Stream &operator << (const std::string &s)
{
std::cout << s << std::endl;
return *this;
}
};
int main()
{
unsigned char *buffer;
//A
Stream str( Wrapper
std::string s(”aoeuao”);
str << s;
}
the compiler throws the following misterous error:
t.cpp: In function 'int main()':
t.cpp:35: error: no match for 'operator<<' in 'str << s'