Skip to content

Commit 5075da5

Browse files
committed
wip
1 parent 1a614aa commit 5075da5

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

include/boost/openmethod/core.hpp

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,18 @@ inline auto final_virtual_ptr(Arg&& obj) {
527527

528528
//! Wide pointer combining pointers to an object and its v-table
529529
//!
530-
//! `virtual_ptr` is a wide pointer that combines a pointer to an object and a
531-
//! pointer to its v-table. It can be constructed from a reference, a pointer,
532-
//! or another (possibly smart) `virtual_ptr`.
530+
//! A `virtual_ptr` is a wide pointer that combines pointers to an object and
531+
//! its v-table. Calls to methods via `virtual_ptr` are as fast as ordinary
532+
//! virtual function calls (typically two instructions).
533533
//!
534-
//! Calls to methods via `virtual_ptr` are as fast as ordinary virtual function
535-
//! calls (typically two instructions).
534+
//! A `virtual_ptr` can be implicitly constructed from a reference, a pointer,
535+
//! or another `virtual_ptr`, provided that they are type-compatible.
536+
//!
537+
//! `virtual_ptr` has specializations that use a `std::shared_ptr` or a
538+
//! `std::unique_ptr` as the pointer to the object. The mechanism can be
539+
//! extended to other smart pointers by specializing @ref virtual_traits. A
540+
//! "plain" `virtual_ptr` can be constructed from a smart `virtual_ptr`, but not
541+
//! the other way around.
536542
//!
537543
//! TODO: link out from mrdocs to macro documentation
538544
//! The default value for `Registry` can be customized by defining the <a href="openmethod/BOOST_OPENMETHOD_DEFAULT_REGISTRY.html">BOOST_OPENMETHOD_DEFAULT_REGISTRY</a>
@@ -749,7 +755,12 @@ class virtual_ptr {
749755
//!
750756
//! Copy the object and v-table pointers from `other` to `this`.
751757
//!
752-
//! `Other` is _not_ required to be a pointer to a polymorphic class.
758+
//! A plain `virtual_ptr` can be constructed from a smart virtual_ptr, as
759+
//! long as the smart pointer's element type is convertible to the plain
760+
//! pointer's element type.
761+
//!
762+
//! `Other::element_type` is _not_ required to be a pointer to a polymorphic
763+
//! class.
753764
//!
754765
//! @par Example
755766
//! @code

0 commit comments

Comments
 (0)