Add pointer support to basic_writer

This commit is contained in:
Victor Zverovich
2018-02-17 09:38:46 +00:00
parent 91721caa42
commit ce4a65ffea
2 changed files with 9 additions and 0 deletions

View File

@@ -2553,6 +2553,14 @@ class basic_writer {
void write(basic_string_view<char_type> str, FormatSpecs... specs) {
write_str(str, format_specs(specs...));
}
template <typename T>
typename std::enable_if<std::is_same<T, void>::value>::type write(const T* p) {
format_specs specs;
specs.flags_ = HASH_FLAG;
specs.type_ = 'x';
write_int(reinterpret_cast<uintptr_t>(p), specs);
}
};
template <typename Range>