| 4 | import <iostream>; |
| 5 | |
| 6 | Person::Person(size_t age, std::string_view name, Gender gender) |
| 7 | : m_age {age}, m_name {name}, m_gender {gender} |
| 8 | { |
| 9 | // Instead of just initializing the members with the argument values, |
| 10 | // you could validate the arguments by doing reasonableness checks. |
| 11 | // e.g. Name mustn't be empty, and age should be less than 130 say. |
| 12 | // To handle a failure sensibly we really need exceptions, |
| 13 | // but we don't get to those until chapter 16. |
| 14 | } |
| 15 | |
| 16 | // Display details of Person object |
| 17 | void Person::who() const |
nothing calls this directly
no outgoing calls
no test coverage detected