fmt::ptr: support unique_ptr and shared_ptr.

This commit is contained in:
HE, Tao
2019-04-18 13:48:44 +08:00
committed by Victor Zverovich
parent d306585a3f
commit 6b20863918
2 changed files with 10 additions and 0 deletions

View File

@@ -3290,6 +3290,12 @@ typename Context::iterator vformat_to(
// Example:
// auto s = format("{}", ptr(p));
template <typename T> inline const void* ptr(const T* p) { return p; }
template <typename T> inline const void* ptr(const std::unique_ptr<T>& p) {
return p.get();
}
template <typename T> inline const void* ptr(const std::shared_ptr<T>& p) {
return p.get();
}
template <typename It, typename Char> struct arg_join {
It begin;