Skip to content
Snippets Groups Projects
Commit ba94f43b authored by Adrien Béraud's avatar Adrien Béraud
Browse files

hash: add fmt formatter

parent 6785fe7e
Branches
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "rng.h" #include "rng.h"
#include <msgpack.hpp> #include <msgpack.hpp>
#include <fmt/core.h>
#ifndef _WIN32 #ifndef _WIN32
#include <netinet/in.h> #include <netinet/in.h>
...@@ -394,3 +395,10 @@ Hash<N>::toString() const ...@@ -394,3 +395,10 @@ Hash<N>::toString() const
} }
} }
template <size_t N>
struct fmt::formatter<dht::Hash<N>>: formatter<string_view> {
constexpr auto format(const dht::Hash<N>& c, format_context& ctx) const {
return formatter<string_view>::format(c.to_view(), ctx);
}
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment