![]() ![]() ![]() Member functions with a const suffix are called “const member functions” or “inspectors.” Member functions without a const suffix are called “non-const member functions” or “mutators. Duplicated Data: Someone has deliberately taken a precise duplicate of the data - or a proportion of it - maybe for backup or reporting purposes. Std::cout << "Foo has been invoked " << ccc.GetInvocations() << " times" << std::endl Ī member function that inspects (rather than mutates) its object.Ī const member function is indicated by a const suffix just after the member function’s parameter list. I would interpret the two phrases as follows: Duplicate Data: Entries that have been added by a system user multiple times, for example, re-registering because you have forgotten your details. #include Ĭounter++ // This works because counter is `mutable` From Longman Business Dictionary duplicate1 /djuplktdu-/ noun 1 countable an exact copy of a document Did you keep a duplicate of the contract 2 in duplicate if a document is written in duplicate, there are two copies of it Provide a separate invoice in duplicate for each purchase order. The const keyword is part of the functions signature which means that you can implement two similar methods, one which is called when the object is const, and one that isn't. (Unless you use mutable, more on that later). When you add the const keyword to a method the this pointer will essentially become a pointer to const object, and you cannot therefore change any member data. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |