You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: include/boost/openmethod/core.hpp
+17-6Lines changed: 17 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -527,12 +527,18 @@ inline auto final_virtual_ptr(Arg&& obj) {
527
527
528
528
//! Wide pointer combining pointers to an object and its v-table
529
529
//!
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).
533
533
//!
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.
536
542
//!
537
543
//! TODO: link out from mrdocs to macro documentation
538
544
//! 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 {
749
755
//!
750
756
//! Copy the object and v-table pointers from `other` to `this`.
751
757
//!
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
0 commit comments