diff options
author | B. Stack <bgstack15@gmail.com> | 2022-04-18 09:47:11 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-04-18 09:47:40 -0400 |
commit | b4b2e4a096fe8fe1ad530a4c181729be05834595 (patch) | |
tree | 84e67ca0a1fb045a12d015fcffca9cd8087c9332 /zen/stl_tools.h | |
parent | Merge branch 'b11.18' into 'master' (diff) | |
download | FreeFileSync-b4b2e4a096fe8fe1ad530a4c181729be05834595.tar.gz FreeFileSync-b4b2e4a096fe8fe1ad530a4c181729be05834595.tar.bz2 FreeFileSync-b4b2e4a096fe8fe1ad530a4c181729be05834595.zip |
add upstream 11.20
Diffstat (limited to 'zen/stl_tools.h')
-rw-r--r-- | zen/stl_tools.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/zen/stl_tools.h b/zen/stl_tools.h index c2e8eff3..0d359641 100644 --- a/zen/stl_tools.h +++ b/zen/stl_tools.h @@ -290,13 +290,26 @@ Num hashArray(ByteIterator first, ByteIterator last) struct StringHash //support for custom string classes with std::unordered_set/map { + using is_transparent = int; //allow heterogenous lookup! + template <class String> size_t operator()(const String& str) const { - const auto* strFirst = strBegin(str); + const auto* const strFirst = strBegin(str); return hashArray<size_t>(strFirst, strFirst + strLength(str)); } }; + +struct StringEqual +{ + using is_transparent = int; //allow heterogenous lookup! + + template <class String1, class String2> + bool operator()(const String1& lhs, const String2& rhs) const + { + return equalString(lhs, rhs); + } +}; } #endif //STL_TOOLS_H_84567184321434 |