From a039c8ad36779903571419cb06cd052f8fc41512 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 29 Mar 2022 17:40:04 +0200 Subject: refactor: use trailing return types --- src/DI/object_type.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/DI/object_type.cpp') diff --git a/src/DI/object_type.cpp b/src/DI/object_type.cpp index 008c4a4..64a23fa 100644 --- a/src/DI/object_type.cpp +++ b/src/DI/object_type.cpp @@ -5,22 +5,22 @@ BaseObjectType::BaseObjectType(const std::type_info &type_info) noexcept { } -bool BaseObjectType::operator==(const BaseObjectType &object_type) const noexcept +auto BaseObjectType::operator==(const BaseObjectType &object_type) const noexcept -> bool { return hash() == object_type.hash(); } -std::size_t BaseObjectType::hash() const noexcept +auto BaseObjectType::hash() const noexcept -> std::size_t { return _type_info.hash_code(); } -std::string_view BaseObjectType::name() const noexcept +auto BaseObjectType::name() const noexcept -> std::string_view { - return std::string_view(_type_info.name()); + return {_type_info.name()}; } -std::size_t ObjectTypeHasher::operator()(const BaseObjectType &object_type) const noexcept +auto ObjectTypeHasher::operator()(const BaseObjectType &object_type) const noexcept -> std::size_t { return object_type.hash(); } -- cgit v1.2.3-18-g5258