@@ -537,23 +537,25 @@ inline vptr_type null_vptr = nullptr;
537537
538538} // namespace detail
539539
540- // ! Create a `virtual_ptr` for an object of an exact known type
541- // !
542- // ! `final_virtual_ptr` creates a `virtual_ptr` to an object, setting its
543- // ! v-table pointer according to the declared type of its argument. It assumes
544- // ! that the static and dynamic types are the same. The v-table pointer is
545- // ! initialized from the `Policy::static_vptr` for the class, which needs
546- // ! not be polymorphic.
547- // !
548- // ! @par Errors If the registry has runtime checks enabled, and the argument is
549- // ! a class type that is polymorphic according to the registry's `rtti` policy,
550- // ! a check is performed to verify that the static and dynamic types are indeed
551- // ! the same. If they are not, and if the registry contains an @ref
552- // ! error_handler policy, its
553- // ! @ref error function is called with a @ref final_error value, then the
554- // ! program is terminated with @ref abort.
555- // !
556- // ! @tparam Registry The registry in which the class is registered.
540+ // ! Creates a `virtual_ptr` for an object of a known dynamic type.
541+ // !
542+ // ! Creates a @ref virtual_ptr to an object, setting its v-table pointer
543+ // ! according to the declared type of its argument. Assumes that the static and
544+ // ! dynamic types are the same. Sets the v-table pointer to the
545+ // ! @ref registry::static_vptr for the class.
546+ // !
547+ // ! `Class` is _not_ required to be polymorphic.
548+ // !
549+ // ! If runtime checks are enabled, and the argument is polymorphic, checks if
550+ // ! the static and dynamic types are the same. If not, calls the error handler
551+ // ! with a @ref final_error value, then terminates the program with @ref abort.
552+ // !
553+ // ! @par Errors
554+ // !
555+ // ! @li @ref final_error The static and dynamic types of the object are
556+ // ! different.
557+ // !
558+ // ! @tparam Registry A @ref registry.
557559// ! @tparam Arg The type of the argument.
558560// ! @param obj A reference to an object.
559561// ! @return A `virtual_ptr<Class, Registry>` pointing to `obj`.
@@ -590,6 +592,12 @@ inline auto final_virtual_ptr(Arg&& obj) {
590592 Registry::template static_vptr<Class>));
591593}
592594
595+ // ! Create a `virtual_ptr` for an object of a known dynamic type.
596+ // !
597+ // ! This is an overload of `final_virtual_ptr` that uses the default
598+ // ! registry as the `Registry` template parameter.
599+ // !
600+ // ! @see @ref final_virtual_ptr
593601template <class Arg >
594602inline auto final_virtual_ptr (Arg&& obj) {
595603 return final_virtual_ptr<BOOST_OPENMETHOD_DEFAULT_REGISTRY, Arg>(
@@ -611,16 +619,14 @@ inline auto final_virtual_ptr(Arg&& obj) {
611619// ! "plain" `virtual_ptr` can be constructed from a smart `virtual_ptr`, but not
612620// ! the other way around.
613621// !
614- // ! TODO: link out from mrdocs to macro documentation
615- // ! The default value for `Registry` can be customized by defining the <a href="openmethod /BOOST_OPENMETHOD_DEFAULT_REGISTRY.html">BOOST_OPENMETHOD_DEFAULT_REGISTRY</a>
622+ // ! The default value for `Registry` can be customized by defining the
623+ // ! [BOOST_OPENMETHOD_DEFAULT_REGISTRY](.. /BOOST_OPENMETHOD_DEFAULT_REGISTRY.html)
616624// ! preprocessor symbol.
617625// !
618626// ! The default value for `Registry` can be customized by defining the
619627// ! xref:BOOST_OPENMETHOD_DEFAULT_REGISTRY.adoc[`BOOST_OPENMETHOD_DEFAULT_REGISTRY`]
620628// ! preprocessor symbol.
621629// !
622- // ! @par Examples
623- // !
624630// ! @par Requirements
625631// !
626632// ! @li @ref virtual_traits must be specialized for `Class&`.
0 commit comments