Question.5
A developer writes a class that holds only value types:
class SensorReading { int id; float temperature; uint32_t timestamp; // No destructor, no copy constructor, no operator= };
Is this class correct?
Select Answer
No -- every class needs a destructor and copy operations
Yes -- but only because all members are public
No -- const members prevent default copy
Yes -- the Rule of Zero: if a class does not manage resources, let the compiler generate all special members; the defaults are correct and optimal