diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-29 17:40:04 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:57 +0200 |
commit | a039c8ad36779903571419cb06cd052f8fc41512 (patch) | |
tree | 4fdced6941a048bdd4b032fab7012bca00a6028e /src/DI/object_type.cpp | |
parent | acf72075ed32e5a679d49ffedc0c28d8ac2aea8b (diff) |
refactor: use trailing return types
Diffstat (limited to 'src/DI/object_type.cpp')
-rw-r--r-- | src/DI/object_type.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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(); } |