mrdocs::dyn_cast_or_null
Dynamic cast if pointer is non‐null and engaged, else nullptr (const).
Synopsis
Declared in <mrdocs/ADT/Polymorphic.hpp>
template<
class To,
class From>
requires ( std::derived_from<std::remove_cvref_t<To>, std::remove_cvref_t<From>> )
[[nodiscard]]
std::add_pointer_t<std::remove_reference_t<To> const>
dyn_cast_or_null(Polymorphic<From> const* pp) noexcept;
Return Value
Pointer to To when the cast succeeds, otherwise nullptr.
|
The return value should not be discarded. |
Parameters
Name |
Description |
pp |
A polymorphic value‐type. |
Created with MrDocs