This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: C++ operators in gcc
- From: John Love-Jensen <eljay at adobe dot com>
- To: Tommy Vercetti <vercetti at zlew dot org>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Mon, 26 Sep 2005 06:19:10 -0500
- Subject: Re: C++ operators in gcc
Hi Tommy,
In C++, every class some freebies. If you write this...
class Foo
{
};
...the compiler generates this...
class Foo
{
public:
Foo();
Foo(Foo const&);
~Foo();
Foo& operator = (Foo const&);
Foo* operator & ();
Foo const* operator & () const;
};
(I presume the definitions of these methods are obvious.)
If you don't want the compiler to generate one-or-more of those functions,
you could explicitly declare them in a private section, and leave them
unimplemented.
HTH,
--Eljay