diff options
| author | Fuwn <[email protected]> | 2024-05-31 00:00:12 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-05-31 00:20:41 -0700 |
| commit | 968e1c4af014b7f40bfaa4f57fcc0f38e5e0d847 (patch) | |
| tree | df80525ad0cc9e4b561bfb0772c30ccc5b64b4a2 /source/person.cc | |
| parent | feat: initial commit (diff) | |
| download | cst_136_assignment_eight-main.tar.xz cst_136_assignment_eight-main.zip | |
Diffstat (limited to 'source/person.cc')
| -rw-r--r-- | source/person.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/person.cc b/source/person.cc index e80e6df..542bfe7 100644 --- a/source/person.cc +++ b/source/person.cc @@ -5,14 +5,14 @@ #include <book_store/person.hh> namespace book_store::consumer { -auto person::last_name() const noexcept -> std::string_view { - return this->_last_name; -} - auto person::first_name() const noexcept -> std::string_view { return this->_first_name; } +auto person::last_name() const noexcept -> std::string_view { + return this->_last_name; +} + auto person::full_name(bool last_first) const noexcept -> std::string { if (last_first) { return this->_last_name + ", " + this->_first_name; @@ -23,14 +23,14 @@ auto person::full_name(bool last_first) const noexcept -> std::string { auto person::id() const noexcept -> std::size_t { return this->_id; } -auto person::last_name(std::string_view last_name) noexcept -> person & { - this->_last_name = last_name; +auto person::first_name(std::string_view first_name) noexcept -> person & { + this->_first_name = first_name; return *this; } -auto person::first_name(std::string_view first_name) noexcept -> person & { - this->_first_name = first_name; +auto person::last_name(std::string_view last_name) noexcept -> person & { + this->_last_name = last_name; return *this; } |