#include #include namespace book_store { [[nodiscard]] auto purchase_error::error() const noexcept -> purchase_error_type { return this->_error; } [[nodiscard]] auto purchase_error::what() const noexcept -> std::string_view { switch (this->_error) { case person_not_found: return "Person not found"; case book_not_found: return "Book not found"; case not_enough_stock: return "Not enough stock"; } } } // namespace book_store