L
lovecreatesbeauty
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 -------------------------
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 -------------------------