diff --git a/include/opendht/infohash.h b/include/opendht/infohash.h index 25753614..7de93365 100644 --- a/include/opendht/infohash.h +++ b/include/opendht/infohash.h @@ -22,6 +22,7 @@ #include "rng.h" #include +#include #ifndef _WIN32 #include @@ -394,3 +395,10 @@ Hash::toString() const } } + +template +struct fmt::formatter>: formatter { + constexpr auto format(const dht::Hash& c, format_context& ctx) const { + return formatter::format(c.to_view(), ctx); + } +};