blob: dfe8c2aed6a6b4c66f815fe1acf39cf9abeee620 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#include "utils.h"
#include <sstream>
#define TO_STR_HEX do { std::stringstream ss; ss << std::hex << v; return std::string(ss.str()); } while (false)
std::string to_string_hex(int v) {
TO_STR_HEX;
}
std::string to_string_hex(unsigned v) {
TO_STR_HEX;
}
std::string to_string_hex(long v) {
TO_STR_HEX;
}
std::string to_string_hex(unsigned long v) {
TO_STR_HEX;
}
std::string to_string_hex(long long v) {
TO_STR_HEX;
}
std::string to_string_hex(unsigned long long v) {
TO_STR_HEX;
}
#undef TO_STR_HEX
|