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++
Implicitly declared/defined member functions and inheritance
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="lovecreatesbeauty, post: 1542386"] The following shortened table comes from a big company's C++ technical document accompanied with its C++ compiler. This company's C++ compiler was/is very popular in Windows platform programming. But I'm not sure whether this table is accurate. The language standard says "Operator functions are inherited", I guess that it means all operator functions are inherited. But that table says operator = is not. Is operator = an exception? Could you please give me a another correct list to explain: 1. which member functions can be declared and/or defined implicitly? 2. which member functions can't be inherited in derived class? Thank you. -- Quotation 1 --------------------------------------- --------------- inheritable ? -- provided implicitly ? ------------------------------------------------------ constructor -------- no ---------------- yes --------- copy constructor --- no ---------------- yes --------- destructor --------- no ---------------- yes --------- operator = --------- no ---------------- yes --------- -- Quotation 1 ends ---------------------------------- -- Quotation 2: ISO/IEC 14882 --------------- 13.5 Overloaded operators 6 ...The meaning of the operator = , (unary) &, and , (comma), predefined for each type, can be changed for specific class and enumeration types by defining operator functions that implement these operators. Operator functions are inherited in the same manner as other base class functions. .... -- Quotation 2 ends ------------------------- [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Implicitly declared/defined member functions and inheritance
Top