±
±ÇÌéÍõ×Ó
Hi,guys!
I find an example from the book "Advanced C++ Programming Styles and
idoms" by James O.Coplien, but it fails to compile.
Code:
class String{
public:
friend String operator+ (const char*,const String&) const;
friend String operator+ (const String&,const char*) const;
...
};
Environment:
Dev C++ 4.9.9.1, Visual C++ 2005 Express Beta
When I deleted the last two const method qualifier, I passed the compile.
Any help is appreciated, thanks!
I find an example from the book "Advanced C++ Programming Styles and
idoms" by James O.Coplien, but it fails to compile.
Code:
class String{
public:
friend String operator+ (const char*,const String&) const;
friend String operator+ (const String&,const char*) const;
...
};
Environment:
Dev C++ 4.9.9.1, Visual C++ 2005 Express Beta
When I deleted the last two const method qualifier, I passed the compile.
Any help is appreciated, thanks!