mirror of
https://github.com/fmtlib/fmt.git
synced 2025-08-02 04:04:44 +02:00
Add ptr to docs
This commit is contained in:
@@ -304,6 +304,10 @@ Utilities
|
|||||||
|
|
||||||
.. doxygentypedef:: fmt::char_t
|
.. 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_string(const T&)
|
||||||
|
|
||||||
.. doxygenfunction:: fmt::to_wstring(const T&)
|
.. doxygenfunction:: fmt::to_wstring(const T&)
|
||||||
|
@@ -3347,9 +3347,15 @@ typename Context::iterator vformat_to(
|
|||||||
return h.context.out();
|
return h.context.out();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Casts ``p`` to ``const void*`` for pointer formatting.
|
/**
|
||||||
// Example:
|
\rst
|
||||||
// auto s = format("{}", ptr(p));
|
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 T* p) { return p; }
|
||||||
template <typename T> inline const void* ptr(const std::unique_ptr<T>& p) {
|
template <typename T> inline const void* ptr(const std::unique_ptr<T>& p) {
|
||||||
return p.get();
|
return p.get();
|
||||||
|
Reference in New Issue
Block a user