Commit 55d3bbd2 authored by Dominik Charousset's avatar Dominik Charousset

Print address when passing void* to deep_to_string

parent 882ba63d
...@@ -177,7 +177,9 @@ public: ...@@ -177,7 +177,9 @@ public:
} }
template <class T> template <class T>
enable_if_tt<std::is_pointer<T>> consume(T ptr) { enable_if_t<std::is_pointer<T>::value
&& !std::is_same<decay_t<T>, void>::value>
consume(T ptr) {
if (ptr) { if (ptr) {
result_ += '*'; result_ += '*';
consume(*ptr); consume(*ptr);
...@@ -186,6 +188,12 @@ public: ...@@ -186,6 +188,12 @@ public:
} }
} }
inline void consume(const void* ptr) {
result_ += "0x";
auto int_val = reinterpret_cast<intptr_t>(ptr);
consume(int_val);
}
/// Print duration types with nanosecond resolution. /// Print duration types with nanosecond resolution.
template <class Rep> template <class Rep>
void consume(std::chrono::duration<Rep, std::nano>& x) { void consume(std::chrono::duration<Rep, std::nano>& x) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment