mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 12:14:26 +00:00
Add ptr to docs
This commit is contained in:
parent
1651b2d433
commit
a0dcfbc57b
@ -304,6 +304,10 @@ Utilities
|
||||
|
||||
.. doxygentypedef:: fmt::char_t
|
||||
|
||||
.. doxygenfunction:: fmt::ptr(const T *)
|
||||
.. doxygenfunction:: fmt::ptr(const std::unique_ptr<T>&)
|
||||
.. doxygenfunction:: fmt::ptr(const std::shared_ptr<T>&)
|
||||
|
||||
.. doxygenfunction:: fmt::to_string(const T&)
|
||||
|
||||
.. doxygenfunction:: fmt::to_wstring(const T&)
|
||||
|
@ -3347,9 +3347,15 @@ typename Context::iterator vformat_to(
|
||||
return h.context.out();
|
||||
}
|
||||
|
||||
// Casts ``p`` to ``const void*`` for pointer formatting.
|
||||
// Example:
|
||||
// auto s = format("{}", ptr(p));
|
||||
/**
|
||||
\rst
|
||||
Converts ``p`` to ``const void*`` for pointer formatting.
|
||||
|
||||
**Example**::
|
||||
|
||||
auto s = fmt::format("{}", fmt::ptr(p));
|
||||
\endrst
|
||||
*/
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user