summaryrefslogtreecommitdiff
path: root/zen/stl_tools.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-04-18 09:47:11 -0400
committerB. Stack <bgstack15@gmail.com>2022-04-18 09:47:40 -0400
commitb4b2e4a096fe8fe1ad530a4c181729be05834595 (patch)
tree84e67ca0a1fb045a12d015fcffca9cd8087c9332 /zen/stl_tools.h
parentMerge branch 'b11.18' into 'master' (diff)
downloadFreeFileSync-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.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