diff options
author | B. Stack <bgstack15@gmail.com> | 2022-04-18 13:48:31 +0000 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-04-18 13:48:31 +0000 |
commit | 8a551d2eff24bdd23bc25caeb8d17207409aae38 (patch) | |
tree | 84e67ca0a1fb045a12d015fcffca9cd8087c9332 /zen/stl_tools.h | |
parent | Merge branch 'b11.18' into 'master' (diff) | |
parent | add upstream 11.20 (diff) | |
download | FreeFileSync-8a551d2eff24bdd23bc25caeb8d17207409aae38.tar.gz FreeFileSync-8a551d2eff24bdd23bc25caeb8d17207409aae38.tar.bz2 FreeFileSync-8a551d2eff24bdd23bc25caeb8d17207409aae38.zip |
Merge branch 'b11.20' into 'master'11.20
add upstream 11.20
See merge request opensource-tracking/FreeFileSync!43
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 |