Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Compiler-Generated Default Functions
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="moleskyca1, post: 2569824"] Hi, In a recent discussion, some of us were in disagreement about the functions the C++ compiler generates. How many functions are generated by the compiler when you declare: class Foo { }; ? I thought 4. As in: class Foo { public: Foo(); // default constructor Foo(const Foo& f); // default copy constructor ~Foo(); // default destructor Foo &operator(const Foo& f); // default assigment operator }; Is this list correct? Is that all? Someone said you must also add the new and delete operators, so that's 6. I have not read the standard, but I'd argue that if this is so, then you should also count operator* () and operator& () [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Compiler-Generated Default Functions
Top