From 5a3353986a19fcabafd039b07b2287057f8022b3 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leroy Date: Tue, 3 Nov 2026 11:49:01 -0500 Subject: [PATCH] doc: troubleshooting: say what a virtual_ptr parameter may be The entry for "virtual_ptr<> must be passed by value or by const reference" began "A method takes a virtual_ptr by non-const lvalue reference", stating as fact what the library refuses. It now names the declarations that produce the message, and the rule: by value or by const reference. Co-Authored-By: Claude Opus 5.5 --- doc/modules/ROOT/pages/troubleshooting.adoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/modules/ROOT/pages/troubleshooting.adoc b/doc/modules/ROOT/pages/troubleshooting.adoc index 247750bc..1f54c244 100644 --- a/doc/modules/ROOT/pages/troubleshooting.adoc +++ b/doc/modules/ROOT/pages/troubleshooting.adoc @@ -385,9 +385,10 @@ gcc. smart pointer to it. | `virtual_ptr<> must be passed by value or by const reference` -| A method takes a `virtual_ptr` by non-const lvalue reference, or by rvalue - reference. Neither works as a virtual parameter: take it by value, which is - cheap, or by const reference. +| A virtual parameter is declared as `virtual_ptr&` or + `virtual_ptr&&`. A method can take a `virtual_ptr` only by value, + `virtual_ptr`, which is cheap, or by const reference, + `const virtual_ptr&`. | `std::shared_ptr cannot be passed by non-const lvalue reference` | Pass a `std::shared_ptr` or a `shared_virtual_ptr` by value, or by const