answersLogoWhite

0

AllQ&AStudy Guides
Best answer

A set function (or setter) is an object mutator. You use it to modify a property of an object such that the object's invariant is maintained. If the object has no invariant, a setter is not required.

A get function (or getter) is an object accessor. You use it to obtain a property from an object such that the object's invariant is maintained. If the object has no invariant, you do not need a getter.

This answer is:
Related answers

A set function (or setter) is an object mutator. You use it to modify a property of an object such that the object's invariant is maintained. If the object has no invariant, a setter is not required.

A get function (or getter) is an object accessor. You use it to obtain a property from an object such that the object's invariant is maintained. If the object has no invariant, you do not need a getter.

View page

A Zeuthen-Segre invariant is an invariant of complex projective surfaces.

View page

C++ has no notion of concepts, but it has the ability to express ideas in code. For instance, if a variable must be non-zero, that idea can be expressed in code via a class invariant. The constructors ensure the variable is non-zero (throwing an exception when the invariant does not hold). Upon entry to any instance member function that modifies the variable (mutators or setters), you already know the invariant holds true (otherwise the instance would not exist), you simply have to ensure the invariant still holds true before those functions return. Thus the entire idea is encapsulated by the class itself. If a class must contain several invariants, it often makes sense to create one class per invariant, then use composition to combine those invariants into a single class.

View page

yes

View page

Andrzej Pelc has written:

'Invariant measures and ideals on discrete groups' -- subject(s): Discrete groups, Ideals (Algebra), Invariant measures

View page
Featured study guide

What is the definition of the domain of function

What does h

It takes an extremely high temperature for nuclear to occur inside the sun

In the box below enter the value that is missing from the table

➡️
See all cards
1.5
2 Reviews
More study guides
3.75
4 Reviews

5.0
1 Review
Search results