summaryrefslogtreecommitdiff
path: root/zen/stl_tools.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-04-18 13:48:31 +0000
committerB. Stack <bgstack15@gmail.com>2022-04-18 13:48:31 +0000
commit8a551d2eff24bdd23bc25caeb8d17207409aae38 (patch)
tree84e67ca0a1fb045a12d015fcffca9cd8087c9332 /zen/stl_tools.h
parentMerge branch 'b11.18' into 'master' (diff)
parentadd upstream 11.20 (diff)
downloadFreeFileSync-11.20.tar.gz
FreeFileSync-11.20.tar.bz2
FreeFileSync-11.20.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.h15
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
bgstack15