From 4593be7065a3065b351a08130d8f45f164da2797 Mon Sep 17 00:00:00 2001 From: Daniel Leonov Date: Mon, 13 Oct 2025 20:21:50 +0300 Subject: [PATCH] File: Add std::hash() template for juce::File Adds compatibility with STL hash maps and hash sets --- modules/juce_core/files/juce_File.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/juce_core/files/juce_File.h b/modules/juce_core/files/juce_File.h index f59e8c25c393..f1708f2994af 100644 --- a/modules/juce_core/files/juce_File.h +++ b/modules/juce_core/files/juce_File.h @@ -1187,3 +1187,13 @@ class JUCE_API File final }; } // namespace juce + +/** @cond */ +namespace std +{ + template <> struct hash + { + size_t operator() (const juce::File& f) const noexcept { return (size_t) f.hashCode64(); } + }; +} +/** @endcond */