Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why is Thyra written with so many non-member helper functions instead of member functions?

0
Posted

Why is Thyra written with so many non-member helper functions instead of member functions?

0

In my C++ class we were told that the beauty of OOP is that functions and data can be put together into classes to combine the operations with the data they operate on. A: Generally member functions should only be used over non-member functions when direct access to private or protected data for functions is required. My minimizing the amount of code that can access non-public data you greatly simplify maintenance. See section 11.3.1 in “The C++ Programming Language: Special Edition” for a discussion of this topic.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123