What are the conditions that have to be met for a condition to be an invariant of the class?

Answer Posted / atul shankhwar

 The condition should hold at the end of every constructor.

 The condition should hold at the end of every mutator(non-const) operation.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to allocate memory dynamically for a reference?

536


Why do we need pointers?

575


What is a singleton class c++?

540


What is data structure in c++?

647


Can recursive program be written in C++?

623






Is c++ vector dynamic?

563


Does c++ vector allocate memory?

521


Can you please explain the difference between using macro and inline functions?

515


How do you define a class in c++?

637


What is setf in c++?

570


When does the c++ compiler create temporary variables?

560


Can static member variables be private?

615


Explain how would you handle a situation where you cannot call the destructor of a local explicitly?

535


What is nested class in c++?

512


What are the advantages of early binding?

602