mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-15 03:45:30 +07:00
remove unnecessary hashed string ctor overloads
This commit is contained in:
@@ -573,15 +573,9 @@ namespace meta_hpp::detail
|
||||
hashed_string& operator=(hashed_string&&) = default;
|
||||
hashed_string& operator=(const hashed_string&) = default;
|
||||
|
||||
constexpr hashed_string(const char* str) noexcept
|
||||
: hash_{fnv1a_hash(str)} {}
|
||||
|
||||
constexpr hashed_string(std::string_view str) noexcept
|
||||
: hash_{fnv1a_hash(str)} {}
|
||||
|
||||
hashed_string(const std::string& str) noexcept
|
||||
: hash_{fnv1a_hash(str)} {}
|
||||
|
||||
constexpr void swap(hashed_string& other) noexcept {
|
||||
std::swap(hash_, other.hash_);
|
||||
}
|
||||
@@ -590,7 +584,7 @@ namespace meta_hpp::detail
|
||||
return hash_;
|
||||
}
|
||||
private:
|
||||
std::size_t hash_{fnv1a_hash("")};
|
||||
std::size_t hash_{fnv1a_hash({})};
|
||||
};
|
||||
|
||||
constexpr void swap(hashed_string& l, hashed_string& r) noexcept {
|
||||
|
||||
@@ -50,15 +50,9 @@ namespace meta_hpp::detail
|
||||
hashed_string& operator=(hashed_string&&) = default;
|
||||
hashed_string& operator=(const hashed_string&) = default;
|
||||
|
||||
constexpr hashed_string(const char* str) noexcept
|
||||
: hash_{fnv1a_hash(str)} {}
|
||||
|
||||
constexpr hashed_string(std::string_view str) noexcept
|
||||
: hash_{fnv1a_hash(str)} {}
|
||||
|
||||
hashed_string(const std::string& str) noexcept
|
||||
: hash_{fnv1a_hash(str)} {}
|
||||
|
||||
constexpr void swap(hashed_string& other) noexcept {
|
||||
std::swap(hash_, other.hash_);
|
||||
}
|
||||
@@ -67,7 +61,7 @@ namespace meta_hpp::detail
|
||||
return hash_;
|
||||
}
|
||||
private:
|
||||
std::size_t hash_{fnv1a_hash("")};
|
||||
std::size_t hash_{fnv1a_hash({})};
|
||||
};
|
||||
|
||||
constexpr void swap(hashed_string& l, hashed_string& r) noexcept {
|
||||
|
||||
Reference in New Issue
Block a user