From 0bb913369dafa02ba2e702b703fac92b42ef1e2a Mon Sep 17 00:00:00 2001 From: Jean-Louis Leroy Date: Wed, 4 Nov 2026 18:07:45 -0500 Subject: [PATCH 1/6] doc: troubleshooting: one section per error, each with an example The page mixed a few worked compilation errors, the runtime errors, and an index of every message. It now has a short intro, then a compile-time section and a runtime section, grouped by category, with each error under a heading that quotes its message and a short example that produces it. The compile-time examples are compile_fail_*.cpp files under examples/troubleshooting/, which test/CMakeLists.txt already globs, so each one is checked against the message it is filed under. They share preamble.hpp, which the page shows once. Examples that only fail on some configurations (C++26 reflection, a translation unit without BMI2) emit the expected text with #error elsewhere, as test/compile_fail_reflection_*.cpp do. The runtime examples are new snippets: not implemented, ambiguous, not initialized, final_virtual_ptr misuse, conflicting definitions (two translation units that disagree on BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS), and the minimal_perfect_hash and minimal_cover_hash search failures. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr --- .../ROOT/examples/snippets/CMakeLists.txt | 15 + .../examples/snippets/errors_ambiguous.cpp | 51 + .../ROOT/examples/snippets/errors_final.cpp | 56 + .../examples/snippets/errors_hash_search.cpp | 49 + .../snippets/errors_not_implemented.cpp | 48 + .../snippets/errors_not_initialized.cpp | 51 + .../snippets/errors_odr_violation.cpp | 34 + .../snippets/errors_too_many_bits.cpp | 60 + .../examples/snippets/odr_violation/other.cpp | 16 + ...ompile_fail_any_cast_mutable_reference.cpp | 23 + .../compile_fail_any_custom_rtti.cpp | 24 + .../compile_fail_classes_forward_declared.cpp | 16 + .../compile_fail_classes_registry_first.cpp | 14 + ...mpile_fail_core_overrider_private_base.cpp | 23 + .../compile_fail_core_overrider_virtual.cpp | 19 + .../compile_fail_diamond_inheritance.cpp | 18 + .../compile_fail_final_virtual_ptr_any.cpp | 20 + ...ile_fail_inplace_vptr_derived_not_base.cpp | 16 + ...ile_fail_inplace_vptr_derived_registry.cpp | 18 + ...pile_fail_method_takes_erased_by_value.cpp | 28 + ...fail_method_takes_virtual_any_by_value.cpp | 16 + ...compile_fail_method_takes_weak_pointer.cpp | 20 + ...e_fail_minimal_cover_hash_without_bmi2.cpp | 31 + .../compile_fail_no_virtual_parameters.cpp | 18 + .../compile_fail_override_private_base.cpp | 19 +- .../compile_fail_overrider_discards_const.cpp | 14 +- .../compile_fail_overrider_parameter_type.cpp | 21 + ...compile_fail_overrider_plain_reference.cpp | 18 + ...pile_fail_overrider_reference_category.cpp | 19 + .../compile_fail_overrider_returns_string.cpp | 20 + ...mpile_fail_overrider_smart_virtual_ptr.cpp | 21 + .../compile_fail_policy_order.cpp | 18 + .../compile_fail_policy_shared_state.cpp | 39 + ...mpile_fail_policy_state_move_may_throw.cpp | 45 + ...compile_fail_policy_state_not_copyable.cpp | 40 + ...pile_fail_register_classes_group_order.cpp | 22 + ...mpile_fail_register_classes_incomplete.cpp | 24 + ...pile_fail_register_classes_mixed_group.cpp | 22 + ...pile_fail_register_classes_not_a_class.cpp | 22 + .../compile_fail_registry_ambiguous_bases.cpp | 26 + ...e_fail_registry_conflicting_affinities.cpp | 19 + ...ile_fail_registry_conflicting_carriers.cpp | 24 + .../compile_fail_registry_declared_late.cpp | 20 + .../compile_fail_registry_mismatch.cpp | 19 + ...compile_fail_registry_mismatch_classes.cpp | 21 + ...mpile_fail_registry_mismatch_parameter.cpp | 24 + .../compile_fail_registry_not_a_registry.cpp | 19 + .../compile_fail_rtti_not_polymorphic.cpp | 18 + ...compile_fail_rtti_without_dynamic_type.cpp | 34 + .../compile_fail_shared_ptr_by_reference.cpp | 16 + .../compile_fail_shared_ptr_overrider.cpp | 22 + .../compile_fail_virtual_by_value.cpp | 18 + .../compile_fail_virtual_non_polymorphic.cpp | 20 + .../compile_fail_virtual_ptr_by_reference.cpp | 19 + ...ompile_fail_virtual_ptr_of_raw_pointer.cpp | 18 + .../compile_fail_weak_ptr_in_virtual_ptr.cpp | 18 + .../compile_fail_wrap_inplace_vptr.cpp | 22 + .../compile_fail_wrap_virtual_any.cpp | 18 + .../examples/troubleshooting/preamble.hpp | 28 + doc/modules/ROOT/pages/troubleshooting.adoc | 1027 +++++++++++------ 60 files changed, 2139 insertions(+), 359 deletions(-) create mode 100644 doc/modules/ROOT/examples/snippets/errors_ambiguous.cpp create mode 100644 doc/modules/ROOT/examples/snippets/errors_final.cpp create mode 100644 doc/modules/ROOT/examples/snippets/errors_hash_search.cpp create mode 100644 doc/modules/ROOT/examples/snippets/errors_not_implemented.cpp create mode 100644 doc/modules/ROOT/examples/snippets/errors_not_initialized.cpp create mode 100644 doc/modules/ROOT/examples/snippets/errors_odr_violation.cpp create mode 100644 doc/modules/ROOT/examples/snippets/errors_too_many_bits.cpp create mode 100644 doc/modules/ROOT/examples/snippets/odr_violation/other.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_any_cast_mutable_reference.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_any_custom_rtti.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_classes_forward_declared.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_classes_registry_first.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_core_overrider_private_base.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_core_overrider_virtual.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_diamond_inheritance.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_final_virtual_ptr_any.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_inplace_vptr_derived_not_base.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_inplace_vptr_derived_registry.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_erased_by_value.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_virtual_any_by_value.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_weak_pointer.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_minimal_cover_hash_without_bmi2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_no_virtual_parameters.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_parameter_type.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_plain_reference.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_reference_category.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_returns_string.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_smart_virtual_ptr.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_order.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_shared_state.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_state_move_may_throw.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_state_not_copyable.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_group_order.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_incomplete.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_mixed_group.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_not_a_class.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_ambiguous_bases.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_conflicting_affinities.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_conflicting_carriers.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_declared_late.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_mismatch.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_mismatch_classes.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_mismatch_parameter.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_not_a_registry.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_rtti_not_polymorphic.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_rtti_without_dynamic_type.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_shared_ptr_by_reference.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_shared_ptr_overrider.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_by_value.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_non_polymorphic.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_ptr_by_reference.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_ptr_of_raw_pointer.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_weak_ptr_in_virtual_ptr.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_wrap_inplace_vptr.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/compile_fail_wrap_virtual_any.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/preamble.hpp diff --git a/doc/modules/ROOT/examples/snippets/CMakeLists.txt b/doc/modules/ROOT/examples/snippets/CMakeLists.txt index 1b7b8c3e..13168cb3 100644 --- a/doc/modules/ROOT/examples/snippets/CMakeLists.txt +++ b/doc/modules/ROOT/examples/snippets/CMakeLists.txt @@ -27,3 +27,18 @@ foreach (cpp ${cpp_files}) add_test(NAME ${test_target} COMMAND ${test_target}) add_dependencies(tests ${test_target}) endforeach() + +# Two translation units that disagree on BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS: +# the other one sits in a subdirectory, out of the glob's reach. +target_sources(boost_openmethod-snippet_errors_odr_violation PRIVATE odr_violation/other.cpp) + +# minimal_cover_hash needs BMI2 in the translation unit that names it. +# BOOST_OPENMETHOD_HAS_BMI2 is the cached result of test/CMakeLists.txt's probe; +# without it, the snippet compiles to an empty test. +if (BOOST_OPENMETHOD_HAS_BMI2) + if (MSVC) + target_compile_options(boost_openmethod-snippet_errors_too_many_bits PRIVATE /arch:AVX2) + else() + target_compile_options(boost_openmethod-snippet_errors_too_many_bits PRIVATE -mbmi2) + endif() +endif() diff --git a/doc/modules/ROOT/examples/snippets/errors_ambiguous.cpp b/doc/modules/ROOT/examples/snippets/errors_ambiguous.cpp new file mode 100644 index 00000000..dd06f2d9 --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/errors_ambiguous.cpp @@ -0,0 +1,51 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +using namespace boost::openmethod; + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; + +// tag::classes[] +BOOST_OPENMETHOD_CLASSES(Animal, Dog); + +BOOST_OPENMETHOD(meet, (virtual_ptr, virtual_ptr), void); + +BOOST_OPENMETHOD_OVERRIDE(meet, (virtual_ptr, virtual_ptr), void) { + // ... +} + +BOOST_OPENMETHOD_OVERRIDE(meet, (virtual_ptr, virtual_ptr), void) { + // ... +} +// end::classes[] + +BOOST_AUTO_TEST_CASE(ambiguous) { + initialize(); + + capture_cerr cerr; + report_on_cerr(); + + reporting([] { + // tag::use[] + Dog snoopy, hector; + + // aborts with error message: ambiguous + meet(snoopy, hector); + // end::use[] + }); + + BOOST_TEST(cerr.str() == "ambiguous\n"); +} diff --git a/doc/modules/ROOT/examples/snippets/errors_final.cpp b/doc/modules/ROOT/examples/snippets/errors_final.cpp new file mode 100644 index 00000000..2194f3ec --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/errors_final.cpp @@ -0,0 +1,56 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// A misused `final_virtual_ptr` is caught by the `runtime_checks` policy, which +// `default_registry` carries only when this symbol is defined. +#ifndef BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#define BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#endif + +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +using namespace boost::openmethod; + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; + +BOOST_OPENMETHOD_CLASSES(Animal, Dog); + +BOOST_OPENMETHOD(poke, (virtual_ptr), void); + +BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr), void) { + // ... +} + +BOOST_AUTO_TEST_CASE(final_construct) { + initialize(); + + capture_cerr cerr; + report_on_cerr(); + + reporting([] { + // tag::use[] + Dog snoopy; + Animal& animal = snoopy; + + // aborts with error message: + // invalid call to final construct: static type = Animal, dynamic type = Dog + poke(final_virtual_ptr(animal)); + // end::use[] + }); + + BOOST_TEST( + cerr.str() == + "invalid call to final construct: static type = Animal, dynamic type = " + "Dog\n"); +} diff --git a/doc/modules/ROOT/examples/snippets/errors_hash_search.cpp b/doc/modules/ROOT/examples/snippets/errors_hash_search.cpp new file mode 100644 index 00000000..1cfdc5ae --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/errors_hash_search.cpp @@ -0,0 +1,49 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// `MaxSeeds = 0` makes the search fail without trying, whatever the type ids: +// the only deterministic way to provoke a search error in a small program. + +#include +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +#include + +using namespace boost::openmethod; + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; + +// tag::classes[] +struct hashed_registry + : default_registry::with> {}; + +BOOST_OPENMETHOD_CLASSES(Animal, Dog, hashed_registry); +// end::classes[] + +BOOST_AUTO_TEST_CASE(search_error) { + capture_cerr cerr; + report_on_cerr(); + + reporting([] { + // tag::init[] + // aborts with error message: + // could not place 2 type ids after trying 0 multipliers + initialize(); + // end::init[] + }); + + BOOST_TEST( + cerr.str() == + "could not place 2 type ids after trying 0 multipliers\n\n"); +} diff --git a/doc/modules/ROOT/examples/snippets/errors_not_implemented.cpp b/doc/modules/ROOT/examples/snippets/errors_not_implemented.cpp new file mode 100644 index 00000000..7de1c569 --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/errors_not_implemented.cpp @@ -0,0 +1,48 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +using namespace boost::openmethod; + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; +struct Cat : Animal {}; + +// tag::classes[] +BOOST_OPENMETHOD_CLASSES(Animal, Dog, Cat); + +BOOST_OPENMETHOD(poke, (virtual_ptr), void); + +BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr), void) { + // ... +} +// end::classes[] + +BOOST_AUTO_TEST_CASE(not_implemented) { + initialize(); + + capture_cerr cerr; + report_on_cerr(); + + reporting([] { + // tag::use[] + Cat felix; + + // aborts with error message: not implemented + poke(felix); + // end::use[] + }); + + BOOST_TEST(cerr.str() == "not implemented\n"); +} diff --git a/doc/modules/ROOT/examples/snippets/errors_not_initialized.cpp b/doc/modules/ROOT/examples/snippets/errors_not_initialized.cpp new file mode 100644 index 00000000..a3935948 --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/errors_not_initialized.cpp @@ -0,0 +1,51 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// A call before `initialize` is caught by the `runtime_checks` policy, which +// `default_registry` carries only when this symbol is defined. +#ifndef BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#define BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#endif + +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +using namespace boost::openmethod; + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; + +// tag::classes[] +BOOST_OPENMETHOD_CLASSES(Animal, Dog); + +BOOST_OPENMETHOD(poke, (virtual_ptr), void); + +BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr), void) { + // ... +} +// end::classes[] + +BOOST_AUTO_TEST_CASE(call_before_initialize) { + capture_cerr cerr; + report_on_cerr(); + + reporting([] { + // tag::use[] + // initialize() has not been called + Dog snoopy; + + // aborts with error message: not initialized + poke(snoopy); + // end::use[] + }); + + BOOST_TEST(cerr.str() == "not initialized\n"); +} diff --git a/doc/modules/ROOT/examples/snippets/errors_odr_violation.cpp b/doc/modules/ROOT/examples/snippets/errors_odr_violation.cpp new file mode 100644 index 00000000..9cb5c035 --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/errors_odr_violation.cpp @@ -0,0 +1,34 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Linked with odr_violation/other.cpp, which is compiled with the opposite +// setting of BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS (see CMakeLists.txt). + +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +using namespace boost::openmethod; + +BOOST_AUTO_TEST_CASE(conflicting_definitions) { + capture_cerr cerr; + report_on_cerr(); + + reporting([] { + // tag::init[] + // aborts with error message: + // conflicting definitions of boost::openmethod::default_registry + initialize(); + // end::init[] + }); + + BOOST_TEST( + cerr.str() == + "conflicting definitions of boost::openmethod::default_registry\n"); +} diff --git a/doc/modules/ROOT/examples/snippets/errors_too_many_bits.cpp b/doc/modules/ROOT/examples/snippets/errors_too_many_bits.cpp new file mode 100644 index 00000000..96a7f990 --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/errors_too_many_bits.cpp @@ -0,0 +1,60 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// `MaxBits = 0` cannot cover two distinct type ids, whatever they are. The +// policy needs BMI2 (see CMakeLists.txt); without it, there is nothing to run. + +#include +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +#include + +using namespace boost::openmethod; + +#if BOOST_OPENMETHOD_HAS_PEXT + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; + +// tag::classes[] +struct covered_registry + : default_registry::with> {}; + +BOOST_OPENMETHOD_CLASSES(Animal, Dog, covered_registry); +// end::classes[] + +BOOST_AUTO_TEST_CASE(too_many_bits) { + capture_cerr cerr; + report_on_cerr(); + + reporting([] { + // tag::init[] + // aborts with error message: + // the smallest bit cover of 2 type ids is 1 bits wide, more than the 0 allowed + initialize(); + // end::init[] + }); + + BOOST_TEST( + cerr.str().find("the smallest bit cover of 2 type ids is ") == 0); + BOOST_TEST(cerr.str().find(" bits wide, more than the 0 allowed\n") != + std::string::npos); +} + +#else + +BOOST_AUTO_TEST_CASE(too_many_bits) { + BOOST_TEST_MESSAGE("minimal_cover_hash needs BMI2: skipped"); +} + +#endif diff --git a/doc/modules/ROOT/examples/snippets/odr_violation/other.cpp b/doc/modules/ROOT/examples/snippets/odr_violation/other.cpp new file mode 100644 index 00000000..244bfe13 --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/odr_violation/other.cpp @@ -0,0 +1,16 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// The second translation unit of errors_odr_violation.cpp: it flips +// BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS, so `default_registry` has another +// definition here than there. + +#ifdef BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#undef BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#else +#define BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#endif + +#include diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_any_cast_mutable_reference.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_any_cast_mutable_reference.cpp new file mode 100644 index 00000000..613c1dfd --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_any_cast_mutable_reference.cpp @@ -0,0 +1,23 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// No static_assert: the `cast` that would make the reference is removed from +// the overload set. gcc and clang say "no matching function for call to", MSVC +// "no matching overloaded function found". +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: no matching + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE(postfix, (Plus& plus, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_any_custom_rtti.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_any_custom_rtti.cpp new file mode 100644 index 00000000..7112ca30 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_any_custom_rtti.cpp @@ -0,0 +1,24 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: requires standard RTTI + +#include "preamble.hpp" + +// tag::content[] +#include +#include + +struct static_registry : default_registry::with {}; + +BOOST_OPENMETHOD( + postfix, (virtual_, std::ostream&), void, static_registry); +// end::content[] + +void call(const std::any& node) { + postfix(node, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_classes_forward_declared.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_classes_forward_declared.cpp new file mode 100644 index 00000000..e7d6697d --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_classes_forward_declared.cpp @@ -0,0 +1,16 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: use_classes: a class is incomplete + +#include "preamble.hpp" + +// tag::content[] +struct Minus; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, Minus); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_classes_registry_first.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_classes_registry_first.cpp new file mode 100644 index 00000000..ae0f7d6d --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_classes_registry_first.cpp @@ -0,0 +1,14 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: a registry must be the last element of the list + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD_CLASSES(my_registry, Node, Plus); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_core_overrider_private_base.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_core_overrider_private_base.cpp new file mode 100644 index 00000000..7169e618 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_core_overrider_private_base.cpp @@ -0,0 +1,23 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: method parameter must be an unambiguous accessible base of corresponding overrider parameter + +#include "preamble.hpp" + +// tag::content[] +class Minus : Node {}; + +struct postfix_id; +using postfix = method, std::ostream&)>; + +void postfix_minus(virtual_ptr, std::ostream& os) { + os << "-"; +} + +BOOST_OPENMETHOD_REGISTER(postfix::override); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_core_overrider_virtual.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_core_overrider_virtual.cpp new file mode 100644 index 00000000..8851b1e8 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_core_overrider_virtual.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: virtual_<> is not allowed in overriders + +#include "preamble.hpp" + +// tag::content[] +struct postfix_id; +using postfix = method, std::ostream&)>; + +void postfix_plus(virtual_, std::ostream&); + +BOOST_OPENMETHOD_REGISTER(postfix::override); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_diamond_inheritance.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_diamond_inheritance.cpp new file mode 100644 index 00000000..dcbbe12c --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_diamond_inheritance.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: class must be an accessible unambiguous base, repeated inheritance is not supported + +#include "preamble.hpp" + +// tag::content[] +struct Left : Node {}; +struct Right : Node {}; +struct Both : Left, Right {}; + +BOOST_OPENMETHOD_CLASSES(Node, Left, Right, Both); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_final_virtual_ptr_any.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_final_virtual_ptr_any.cpp new file mode 100644 index 00000000..a3ec89ef --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_final_virtual_ptr_any.cpp @@ -0,0 +1,20 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// "use of deleted function" on gcc, "call to deleted function" on clang, +// "attempting to reference a deleted function" on MSVC. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: deleted function + +#include "preamble.hpp" + +// tag::content[] +#include + +void print(std::any& node) { + final_virtual_ptr(node); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_inplace_vptr_derived_not_base.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_inplace_vptr_derived_not_base.cpp new file mode 100644 index 00000000..4a0e52f4 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_inplace_vptr_derived_not_base.cpp @@ -0,0 +1,16 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: class must inherit from inplace_vptr_base + +#include "preamble.hpp" + +// tag::content[] +#include + +struct Minus : Node, inplace_vptr_derived {}; +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_inplace_vptr_derived_registry.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_inplace_vptr_derived_registry.cpp new file mode 100644 index 00000000..0de18e85 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_inplace_vptr_derived_registry.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: registry can be specified only for root classes + +#include "preamble.hpp" + +// tag::content[] +#include + +struct Term : inplace_vptr_base {}; + +struct Sum : Term, inplace_vptr_derived {}; +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_erased_by_value.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_erased_by_value.cpp new file mode 100644 index 00000000..b51024b5 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_erased_by_value.cpp @@ -0,0 +1,28 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: an owning type_erasure::any must be passed by reference + +#include "preamble.hpp" + +// tag::content[] +#include +#include +#include +#include + +namespace te = boost::type_erasure; + +using any_node = + te::any, te::relaxed>>; + +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); +// end::content[] + +void call(const any_node& node) { + postfix(node, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_virtual_any_by_value.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_virtual_any_by_value.cpp new file mode 100644 index 00000000..3259e520 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_virtual_any_by_value.cpp @@ -0,0 +1,16 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: virtual_any must be passed by reference + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (virtual_std_any, std::ostream&), void); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_weak_pointer.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_weak_pointer.cpp new file mode 100644 index 00000000..e2d70b45 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_weak_pointer.cpp @@ -0,0 +1,20 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: a weak pointer cannot be a virtual parameter + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (virtual_>, std::ostream&), void); +// end::content[] + +void call(const std::shared_ptr& plus) { + postfix(std::weak_ptr(plus), std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_minimal_cover_hash_without_bmi2.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_minimal_cover_hash_without_bmi2.cpp new file mode 100644 index 00000000..30a7a8ce --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_minimal_cover_hash_without_bmi2.cpp @@ -0,0 +1,31 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Fires only where the translation unit has no PEXT instruction: x86-64 +// without -mbmi2, or any other architecture. Where it has one, there is nothing +// to check, so produce the expected diagnostic instead, as the reflection tests +// do without reflection. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: minimal_cover_hash needs BMI2 + +#include "preamble.hpp" + +#include + +#if BOOST_OPENMETHOD_HAS_PEXT +#error minimal_cover_hash needs BMI2 +#else + +// tag::content[] +#include + +struct covered_registry : + default_registry::with> {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, covered_registry); +// end::content[] + +#endif diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_no_virtual_parameters.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_no_virtual_parameters.cpp new file mode 100644 index 00000000..746fe986 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_no_virtual_parameters.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: method has no virtual parameters + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (Node&, std::ostream&), void); +// end::content[] + +void call(Plus& plus) { + postfix(plus, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_override_private_base.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_override_private_base.cpp index 21147bc4..aed9faa5 100644 --- a/doc/modules/ROOT/examples/troubleshooting/compile_fail_override_private_base.cpp +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_override_private_base.cpp @@ -7,24 +7,15 @@ // Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). // expected-error: cannot find 'postfix' method that accepts the same arguments as the overrider -// tag::content[] -#include - -#include - -using boost::openmethod::virtual_ptr; +#include "preamble.hpp" -class Node { - public: - virtual ~Node() = default; -}; - -class Plus : Node {}; +// tag::content[] +class Minus : Node {}; BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); BOOST_OPENMETHOD_OVERRIDE( - postfix, (virtual_ptr, std::ostream& os), void) { - os << "+"; + postfix, (virtual_ptr, std::ostream& os), void) { + os << "-"; } // end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_discards_const.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_discards_const.cpp index 000d862d..c0592580 100644 --- a/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_discards_const.cpp +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_discards_const.cpp @@ -7,19 +7,9 @@ // Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). // expected-error: overrider parameter discards const qualifier -// tag::content[] -#include - -#include - -using boost::openmethod::virtual_ptr; - -struct Node { - virtual ~Node() = default; -}; - -struct Plus : Node {}; +#include "preamble.hpp" +// tag::content[] BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); BOOST_OPENMETHOD_OVERRIDE( diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_parameter_type.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_parameter_type.cpp new file mode 100644 index 00000000..9e3e4e4a --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_parameter_type.cpp @@ -0,0 +1,21 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: non-virtual parameter types must match exactly + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (virtual_ptr, std::ofstream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_plain_reference.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_plain_reference.cpp new file mode 100644 index 00000000..e3493a64 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_plain_reference.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: virtual_ptr<> is required in overrider in same position as in method + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE(postfix, (Plus&, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_reference_category.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_reference_category.cpp new file mode 100644 index 00000000..ff7d8738 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_reference_category.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: different virtual_ptr<> reference categories + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (const virtual_ptr&, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_returns_string.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_returns_string.cpp new file mode 100644 index 00000000..ba2a6def --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_returns_string.cpp @@ -0,0 +1,20 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: overrider return type is not convertible to method return type + +#include + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(value, (virtual_ptr), int); + +BOOST_OPENMETHOD_OVERRIDE(value, (virtual_ptr), std::string) { + return "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_smart_virtual_ptr.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_smart_virtual_ptr.cpp new file mode 100644 index 00000000..3100ade4 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_overrider_smart_virtual_ptr.cpp @@ -0,0 +1,21 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: different virtual_ptr<> pointer kinds + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (shared_virtual_ptr, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_order.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_order.cpp new file mode 100644 index 00000000..94a1b99d --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_order.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: the type_hash policy must appear before vptr_vector + +#include "preamble.hpp" + +// tag::content[] +struct hashed_registry : + default_registry::without::with< + policies::fast_perfect_hash> {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, hashed_registry); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_shared_state.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_shared_state.cpp new file mode 100644 index 00000000..952901bc --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_shared_state.cpp @@ -0,0 +1,39 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: two or more stateful policies in this registry share the same nested + +#include "preamble.hpp" + +// tag::content[] +struct counter { + int n = 0; +}; + +struct calls_policy { + using category = calls_policy; + + template + struct fn { + using state = counter; + }; +}; + +struct errors_policy { + using category = errors_policy; + + template + struct fn { + using state = counter; + }; +}; + +struct counting_registry : + default_registry::with {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, counting_registry); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_state_move_may_throw.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_state_move_may_throw.cpp new file mode 100644 index 00000000..e3a6e4e5 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_state_move_may_throw.cpp @@ -0,0 +1,45 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: must be nothrow move-assignable + +#include + +#include "preamble.hpp" + +// tag::content[] +#include + +struct cache_policy { + using category = cache_policy; + + template + struct fn { + struct state { + state() = default; + state(const state&) = default; + auto operator=(const state&) -> state& = default; + + auto operator=(state&&) -> state& { + return *this; + } + }; + + template + static void initialize(const Context&, const std::tuple&) { + } + }; +}; + +struct cached_registry : default_registry::with {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, cached_registry); + +void init() { + initialize(); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_state_not_copyable.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_state_not_copyable.cpp new file mode 100644 index 00000000..54e28c84 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_state_not_copyable.cpp @@ -0,0 +1,40 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: must be copyable: initialize.. saves it + +#include + +#include "preamble.hpp" + +// tag::content[] +#include +#include + +struct cache_policy { + using category = cache_policy; + + template + struct fn { + struct state { + std::unique_ptr data; + }; + + template + static void initialize(const Context&, const std::tuple&) { + } + }; +}; + +struct cached_registry : default_registry::with {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, cached_registry); + +void init() { + initialize(); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_group_order.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_group_order.cpp new file mode 100644 index 00000000..047db794 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_group_order.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Without C++26 reflection there is nothing to check, so produce the expected +// diagnostic instead, as test/compile_fail_reflection_*.cpp do. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: order the groups as namespaces, classes, registries + +#include "preamble.hpp" + +#if !BOOST_OPENMETHOD_HAS_REFLECTION +#error order the groups as namespaces, classes, registries +#else + +// tag::content[] +BOOST_OPENMETHOD_REGISTER(register_classes<{^^my_registry}, {^^Node, ^^Plus}>); +// end::content[] + +#endif diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_incomplete.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_incomplete.cpp new file mode 100644 index 00000000..9a603cf0 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_incomplete.cpp @@ -0,0 +1,24 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Without C++26 reflection there is nothing to check, so produce the expected +// diagnostic instead, as test/compile_fail_reflection_*.cpp do. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: a listed class must be complete + +#include "preamble.hpp" + +#if !BOOST_OPENMETHOD_HAS_REFLECTION +#error a listed class must be complete +#else + +// tag::content[] +struct Minus; + +BOOST_OPENMETHOD_REGISTER(register_classes<{^^Node, ^^Minus}>); +// end::content[] + +#endif diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_mixed_group.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_mixed_group.cpp new file mode 100644 index 00000000..621b4892 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_mixed_group.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Without C++26 reflection there is nothing to check, so produce the expected +// diagnostic instead, as test/compile_fail_reflection_*.cpp do. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: a group holds one kind of reflection + +#include "preamble.hpp" + +#if !BOOST_OPENMETHOD_HAS_REFLECTION +#error a group holds one kind of reflection +#else + +// tag::content[] +BOOST_OPENMETHOD_REGISTER(register_classes<{^^Node, ^^Plus, ^^my_registry}>); +// end::content[] + +#endif diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_not_a_class.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_not_a_class.cpp new file mode 100644 index 00000000..6cef2a1d --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_register_classes_not_a_class.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Without C++26 reflection there is nothing to check, so produce the expected +// diagnostic instead, as test/compile_fail_reflection_*.cpp do. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: a group holds reflections of namespaces, classes or registries + +#include "preamble.hpp" + +#if !BOOST_OPENMETHOD_HAS_REFLECTION +#error a group holds reflections of namespaces, classes or registries +#else + +// tag::content[] +BOOST_OPENMETHOD_REGISTER(register_classes<{^^int}>); +// end::content[] + +#endif diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_ambiguous_bases.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_ambiguous_bases.cpp new file mode 100644 index 00000000..e6a60630 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_ambiguous_bases.cpp @@ -0,0 +1,26 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: cannot tell which registry this class belongs to + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + friend auto boost_openmethod_registry(Expr*) -> my_registry; +}; + +struct Term { + virtual ~Term() = default; + friend auto boost_openmethod_registry(Term*) -> default_registry; +}; + +struct Sum : Expr, Term {}; + +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_conflicting_affinities.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_conflicting_affinities.cpp new file mode 100644 index 00000000..7a35e012 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_conflicting_affinities.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: the classes carry conflicting registry affinities + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, Expr); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_conflicting_carriers.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_conflicting_carriers.cpp new file mode 100644 index 00000000..bcd77a7d --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_conflicting_carriers.cpp @@ -0,0 +1,24 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: virtual parameters carry conflicting registries + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +BOOST_OPENMETHOD( + print, (virtual_ptr, virtual_ptr, std::ostream&), void); +// end::content[] + +void call(Plus& plus, Expr& expr) { + print(plus, expr, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_declared_late.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_declared_late.cpp new file mode 100644 index 00000000..a3a492b2 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_declared_late.cpp @@ -0,0 +1,20 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: this class declared its registry affinity after it was first mentioned + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + virtual_ptr next; + using boost_openmethod_registry = my_registry; +}; + +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_mismatch.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_mismatch.cpp new file mode 100644 index 00000000..a0820a4a --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_mismatch.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: registry mismatch + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD( + postfix, (virtual_ptr, std::ostream&), void, my_registry); +// end::content[] + +void call(Plus& plus) { + postfix(plus, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_mismatch_classes.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_mismatch_classes.cpp new file mode 100644 index 00000000..671f39da --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_mismatch_classes.cpp @@ -0,0 +1,21 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: registry mismatch: a class declares an affinity for another registry + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +struct Sum : Expr {}; + +BOOST_OPENMETHOD_CLASSES(Expr, Sum, default_registry); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_mismatch_parameter.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_mismatch_parameter.cpp new file mode 100644 index 00000000..96efd57e --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_mismatch_parameter.cpp @@ -0,0 +1,24 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: registry mismatch: the parameter belongs to another registry + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +BOOST_OPENMETHOD( + postfix, (virtual_, std::ostream&), void, default_registry); +// end::content[] + +void call(Expr& expr) { + postfix(expr, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_not_a_registry.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_not_a_registry.cpp new file mode 100644 index 00000000..c226902d --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_not_a_registry.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: boost_openmethod_registry must return a registry + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = int; +}; + +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_rtti_not_polymorphic.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_rtti_not_polymorphic.cpp new file mode 100644 index 00000000..e736ceb2 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_rtti_not_polymorphic.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: the rtti policy does not deem this class polymorphic + +#include "preamble.hpp" + +// tag::content[] +struct Literal {}; + +void print(Literal& literal) { + default_registry::policy::dynamic_vptr(literal); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_rtti_without_dynamic_type.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_rtti_without_dynamic_type.cpp new file mode 100644 index 00000000..1284b042 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_rtti_without_dynamic_type.cpp @@ -0,0 +1,34 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: the rtti policy deems this class polymorphic, so it must provide dynamic_type + +#include +#include + +#include "preamble.hpp" + +// tag::content[] +struct my_rtti : policies::rtti { + template + struct fn : defaults { + template + static constexpr bool is_polymorphic = std::is_polymorphic_v; + + template + static auto static_type() -> type_id { + return &typeid(T); + } + }; +}; + +struct rtti_registry : default_registry::with {}; + +void print(Node& node) { + virtual_ptr p(node); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_shared_ptr_by_reference.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_shared_ptr_by_reference.cpp new file mode 100644 index 00000000..585932b1 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_shared_ptr_by_reference.cpp @@ -0,0 +1,16 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: std::shared_ptr cannot be passed by non-const lvalue reference + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (shared_virtual_ptr&, std::ostream&), void); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_shared_ptr_overrider.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_shared_ptr_overrider.cpp new file mode 100644 index 00000000..45952a57 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_shared_ptr_overrider.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: cast only allowed to a shared_ptr + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD( + postfix, (virtual_&>, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (std::shared_ptr& plus, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_by_value.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_by_value.cpp new file mode 100644 index 00000000..bc375ef9 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_by_value.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: virtual_traits not specialized for type + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); +// end::content[] + +void call(Plus& plus) { + postfix(plus, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_non_polymorphic.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_non_polymorphic.cpp new file mode 100644 index 00000000..65862ca2 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_non_polymorphic.cpp @@ -0,0 +1,20 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: virtual_<> parameter is not a polymorphic class + +#include "preamble.hpp" + +// tag::content[] +struct Literal {}; + +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); +// end::content[] + +void call(Literal& literal) { + postfix(literal, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_ptr_by_reference.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_ptr_by_reference.cpp new file mode 100644 index 00000000..ef375ca2 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_ptr_by_reference.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: virtual_ptr<> must be passed by value or by const reference + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr&, std::ostream&), void); +// end::content[] + +void call(Plus& plus) { + virtual_ptr node(plus); + postfix(node, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_ptr_of_raw_pointer.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_ptr_of_raw_pointer.cpp new file mode 100644 index 00000000..83461de7 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_virtual_ptr_of_raw_pointer.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: virtual_ptr<> takes a class or a smart pointer + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +void print(Node* node) { + postfix(node, std::cout); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_weak_ptr_in_virtual_ptr.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_weak_ptr_in_virtual_ptr.cpp new file mode 100644 index 00000000..269a840c --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_weak_ptr_in_virtual_ptr.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: a std::weak_ptr cannot be wrapped in a virtual_ptr.*use weak_virtual_ptr + +#include "preamble.hpp" + +// tag::content[] +#include + +void watch(std::weak_ptr node) { + virtual_ptr> p(node); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_wrap_inplace_vptr.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_wrap_inplace_vptr.cpp new file mode 100644 index 00000000..b4f6ece5 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_wrap_inplace_vptr.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: do not wrap an object that has a boost_openmethod_vptr overload in a virtual_ptr + +#include "preamble.hpp" + +// tag::content[] +#include + +struct Term : inplace_vptr_base { + virtual ~Term() = default; +}; + +void print(Term& term) { + virtual_ptr p(term); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_wrap_virtual_any.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_wrap_virtual_any.cpp new file mode 100644 index 00000000..272be502 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_wrap_virtual_any.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page, and checked like test/compile_fail_*.cpp. +// Expected diagnostic, as a CMake regex (see test/CMakeLists.txt). +// expected-error: do not wrap a virtual_any in a virtual_ptr + +#include "preamble.hpp" + +// tag::content[] +#include + +void print(virtual_std_any& node) { + virtual_ptr p(node); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/preamble.hpp b/doc/modules/ROOT/examples/troubleshooting/preamble.hpp new file mode 100644 index 00000000..91dd2817 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/preamble.hpp @@ -0,0 +1,28 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// The declarations that the compile_fail_*.cpp examples in this directory +// share. The troubleshooting page shows them once, above the examples. + +#ifndef BOOST_OPENMETHOD_DOC_TROUBLESHOOTING_PREAMBLE_HPP +#define BOOST_OPENMETHOD_DOC_TROUBLESHOOTING_PREAMBLE_HPP + +// tag::content[] +#include + +#include + +using namespace boost::openmethod; + +struct Node { + virtual ~Node() = default; +}; + +struct Plus : Node {}; + +struct my_registry : default_registry::with {}; +// end::content[] + +#endif diff --git a/doc/modules/ROOT/pages/troubleshooting.adoc b/doc/modules/ROOT/pages/troubleshooting.adoc index 1f54c244..0a0251b5 100644 --- a/doc/modules/ROOT/pages/troubleshooting.adoc +++ b/doc/modules/ROOT/pages/troubleshooting.adoc @@ -6,13 +6,11 @@ toc::[] -OpenMethod catches most mistakes at compile time, and says what went wrong in a -`static_assert`. The rest surface at run time: cpp:initialize[] reports -inconsistencies in the registered classes, methods and overriders, and a -method call reports a combination of arguments it cannot dispatch. - -This page walks through the mistakes that are made most often, then lists every -diagnostic the library emits, with its cause and its remedy. +OpenMethod catches most mistakes at compile time. The rest surface at run time: +cpp:initialize[] reports inconsistencies in the registered classes, methods and +overriders, and a method call reports a combination of arguments that it cannot +dispatch. This page lists every error that the library reports, each under its +message, with a short example that produces it. ## Compilation errors @@ -36,27 +34,96 @@ Search the output for the message: | `error C2338: static assertion failed: '_message_'` |=== -Read the first one. The errors that follow it are usually its consequences. +Read the first one. The errors that follow it are usually its consequences. In +particular, after an error in an overrider, gcc also reports +`BOOST_OPENMETHOD_OVERRIDE: the overrider does not match the method` or +`virtual_ptr category mismatch`, and after an error in a method, a +`static assertion failed` with no message. These add nothing to the first +error. -### The overrider matches no method +The examples below start from these declarations: [source,c++] ---- -include::example$troubleshooting/compile_fail_override_private_base.cpp[tag=content] +include::example$troubleshooting/preamble.hpp[tag=content] +---- + +### Methods + +#### `method has no virtual parameters` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_no_virtual_parameters.cpp[tag=content] +---- + +A method dispatches on the parameters declared with `virtual_` or +`virtual_ptr`. Without one, it is an ordinary function. Here, the first +parameter is `virtual_` or `virtual_ptr`. + +#### `virtual_traits not specialized for type` + +[source,c++] ---- +include::example$troubleshooting/compile_fail_virtual_by_value.cpp[tag=content] +---- + +A `virtual_` parameter is a reference, a pointer, or a smart pointer that +OpenMethod supports: `virtual_`, not `virtual_`. Dispatching on an +object passed by value would slice it. -[source,console] +#### `virtual_<> parameter is not a polymorphic class...` + +[source,c++] ---- -static assertion failed: BOOST_OPENMETHOD_OVERRIDE: cannot find 'postfix' method that accepts the same arguments as the overrider +include::example$troubleshooting/compile_fail_virtual_non_polymorphic.cpp[tag=content] +---- + +The default registry finds the dynamic type of an object with `typeid`, which +yields it only for a polymorphic class. Give the root of the hierarchy a +virtual destructor. See also <>, the same mistake made +with `virtual_ptr`. + +#### `virtual_ptr<> must be passed by value or by const reference` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_virtual_ptr_by_reference.cpp[tag=content] +---- + +A method takes a `virtual_ptr` by value - it is a pair of pointers, cheap to +copy - or by const reference. It cannot take it by non-const reference, or by +rvalue reference, because it may have to build one from its argument. + +#### `virtual_ptr<> takes a class or a smart pointer: virtual_ptr, not virtual_ptr` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_virtual_ptr_of_raw_pointer.cpp[tag=content] +---- + +A `virtual_ptr` is a pointer already. Its argument is the class, or a smart +pointer to it: `virtual_ptr`, `virtual_ptr>`. The +method declaration compiles, but the first use of `virtual_ptr` does +not. + +### Overriders + +[#override_not_found] +#### `BOOST_OPENMETHOD_OVERRIDE: cannot find '...' method that accepts the same arguments as the overrider` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_override_private_base.cpp[tag=content] ---- xref:reference:BOOST_OPENMETHOD_OVERRIDE.adoc[BOOST_OPENMETHOD_OVERRIDE] does not take the method as an argument: it finds the method by overload resolution, looking for a method of the same name that can be called with the overrider's -arguments. Here `Plus` derives from `Node` _privately_ - `class` makes the -inheritance private unless told otherwise - so a `virtual_ptr` does not +arguments. Here `Minus` derives from `Node` _privately_ - `class` makes the +inheritance private unless told otherwise - so a `virtual_ptr` does not convert to a `virtual_ptr`, and `postfix` cannot be called with one. The -fix is `class Plus : public Node`. +fix is `class Minus : public Node`. The other causes of the same message are: @@ -78,33 +145,30 @@ The other causes of the same message are: * The method takes a smart `virtual_ptr`, such as cpp:shared_virtual_ptr[], and the overrider a plain `virtual_ptr`, or one over another kind of smart - pointer. A plain `virtual_ptr` in the method and a smart one in the overrider - has a message of its own: `different virtual_ptr<> pointer kinds`. + pointer. The opposite mistake has a message of its own: + <>. * A virtual parameter of the overrider is `const` where the method's is not. - The opposite mistake has a message of its own: see - <<_the_overrider_discards_const>>. + The opposite mistake has a message of its own: <>. -* A non-virtual parameter differs from the method's. +* A non-virtual parameter differs from the method's in a way that no + conversion bridges. When a conversion does, the message is + <>. * The method is in another namespace, and its arguments do not make it visible through argument-dependent lookup. See xref:namespaces.adoc[Namespaces]. When the overrider and the method differ only by their registry, the message -says so instead: `registry mismatch`. +says so instead: <>. -### The overrider discards `const` +[#overrider_discards_const] +#### `overrider parameter discards const qualifier` [source,c++] ---- include::example$troubleshooting/compile_fail_overrider_discards_const.cpp[tag=content] ---- -[source,console] ----- -static assertion failed: overrider parameter discards const qualifier ----- - The method takes a `virtual_ptr`: it promises not to modify the node. The overrider for `Plus` takes a `virtual_ptr`, through which it could. When the method calls the overrider, it casts its argument to the type @@ -116,7 +180,86 @@ The same applies to references and pointers: an overrider for the error from the cast itself, which names the two classes: `dynamic_cast from 'const Node' to 'Plus &' casts away qualifiers`. -### The class is not polymorphic +#### `virtual_ptr<> is required in overrider in same position as in method` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_overrider_plain_reference.cpp[tag=content] +---- + +Where the method takes a `virtual_ptr`, the overrider takes one too: +`virtual_ptr`. + +#### `different virtual_ptr<> reference categories` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_overrider_reference_category.cpp[tag=content] +---- + +The method takes the `virtual_ptr` by value, and the overrider by const +reference. Use the same form in both. + +[#overrider_pointer_kind] +#### `different virtual_ptr<> pointer kinds` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_overrider_smart_virtual_ptr.cpp[tag=content] +---- + +The method takes a plain `virtual_ptr`, and the overrider a smart one. Use the +same kind in both: `virtual_ptr` for `virtual_ptr`, +`shared_virtual_ptr` for `shared_virtual_ptr`. + +[#overrider_parameter_type] +#### `non-virtual parameter types must match exactly` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_overrider_parameter_type.cpp[tag=content] +---- + +The non-virtual parameters of an overrider have the same types as the +method's. Here, `std::ostream&` would have to be cast to `std::ofstream&`, +which cannot be done safely. + +#### `overrider return type is not convertible to method return type` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_overrider_returns_string.cpp[tag=content] +---- + +An overrider returns the method's return type, or a type that converts to it, +such as `Plus*` for `Node*`. If the method returns `void`, so does the +overrider. + +#### `virtual_<> is not allowed in overriders` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_core_overrider_virtual.cpp[tag=content] +---- + +An overrider takes the plain type: `Plus&` where the method takes +`virtual_`. This message comes from the core API, as above. Through +`BOOST_OPENMETHOD_OVERRIDE`, the same mistake gives <>. + +#### `method parameter must be an unambiguous accessible base of corresponding overrider parameter` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_core_overrider_private_base.cpp[tag=content] +---- + +The same mistake as in <>, made with the core API, which is +given the method instead of looking for it. + +### Classes and virtual pointers + +[#call_non_polymorphic] +#### `no matching function for call to '_method_'` [source,c++] ---- @@ -143,7 +286,8 @@ type of the object. The default registry finds it with `typeid`, which yields the dynamic type only for a polymorphic class, so `virtual_ptr` does not accept `Node` or classes derived from it, and the call matches no overload. There is no `static_assert` here, because the mistake is not in a declaration that the -library sees: it is the absence of a conversion. +library sees: it is the absence of a conversion. For the same reason, +`virtual_ptr p(plus)` reports that no constructor matches. The usual fix is to make the root of the hierarchy polymorphic by giving it a virtual destructor - which it needs anyway, if objects are ever deleted through @@ -167,429 +311,646 @@ class, OpenMethod has no way to find out, even with runtime checks enabled. Passed a `Node&` that refers to a `Plus`, `final_virtual_ptr` makes a `virtual_ptr` to a `Node`, and the call dispatches on `Node`. -The same mistake made with `virtual_` instead of `virtual_ptr`, as in -`BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void)`, is caught -when the method is declared, and reported with a message of its own: -`virtual_<> parameter is not a polymorphic class`. +#### `class must be an accessible unambiguous base, repeated inheritance is not supported` -## Runtime errors +[source,c++] +---- +include::example$troubleshooting/compile_fail_diamond_inheritance.cpp[tag=content] +---- -Errors detected at run time are passed to the registry's -cpp:error_handler[] policy. The one in cpp:default_registry[] writes a short -description of the error to `stderr`, then the program is terminated with -`abort`. xref:error_handling.adoc[Error Handling] explains how to change that, -for example to throw an exception. +`Both` inherits `Node` twice, through `Left` and through `Right`, so a pointer +to a `Both` cannot be converted to a pointer to a `Node`. Derive `Left` and +`Right` from `Node` virtually. A private base gives the same message. -cpp:initialize[] always checks the classes, methods and overriders it is -given, and a call that finds no overrider, or several ambiguous ones, is always -reported. The other checks made during a call - for an unregistered class, a -call before `initialize`, a misused cpp:final_virtual_ptr[] - are made only if -the registry contains the cpp:runtime_checks[] policy. `default_registry` -contains it if -xref:reference:BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS.adoc[BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS] -is defined, which is recommended in debug builds. The symbol changes the -definition of `default_registry`, so it must be defined in all the translation -units of the program, or in none. +#### `use_classes: a class is incomplete` -### Missing class registrations +[source,c++] +---- +include::example$troubleshooting/compile_fail_classes_forward_declared.cpp[tag=content] +---- -Every class that appears in a virtual parameter, in a method or in an -overrider, must be registered with -xref:reference:BOOST_OPENMETHOD_CLASSES.adoc[BOOST_OPENMETHOD_CLASSES]. So must -the class of every object passed as a virtual argument. cpp:initialize[] -detects the first two omissions: +A class is registered where it is only declared. Register it after its +definition. + +#### `a registry must be the last element of the list` [source,c++] ---- -include::example$snippets/errors_missing_class_method.cpp[tag=classes] +include::example$troubleshooting/compile_fail_classes_registry_first.cpp[tag=content] +---- -include::example$snippets/errors_missing_class_method.cpp[tag=init,indent=0] +A class list names its registry last: +`BOOST_OPENMETHOD_CLASSES(Node, Plus, my_registry)`. + +#### `do not wrap an object that has a boost_openmethod_vptr overload in a virtual_ptr...` + +[source,c++] ---- +include::example$troubleshooting/compile_fail_wrap_inplace_vptr.cpp[tag=content] +---- + +The object carries its own v-table pointer, here because it derives from +cpp:inplace_vptr_base[]. Pass the object itself to methods, which read the +v-table pointer from it. + +#### `class must inherit from inplace_vptr_base` [source,c++] ---- -include::example$snippets/errors_missing_class_overrider.cpp[tag=classes] +include::example$troubleshooting/compile_fail_inplace_vptr_derived_not_base.cpp[tag=content] +---- -include::example$snippets/errors_missing_class_overrider.cpp[tag=init,indent=0] +The bases passed to cpp:inplace_vptr_derived[] are themselves `inplace_vptr` +classes: here, `Node` would have to derive from `inplace_vptr_base`. + +#### `registry can be specified only for root classes` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_inplace_vptr_derived_registry.cpp[tag=content] ---- -The third one can be detected only during the call, and only if runtime checks -are enabled. Otherwise, the call reads a v-table pointer that was never set up, -and the behavior is undefined: it may call the wrong overrider, or crash. +Only the root of an `inplace_vptr` hierarchy names the registry, as in +`inplace_vptr_base`. Its derived classes inherit it. + +#### `the rtti policy deems this class polymorphic, so it must provide dynamic_type` [source,c++] ---- -include::example$snippets/errors_missing_class_call.cpp[tag=classes] +include::example$troubleshooting/compile_fail_rtti_without_dynamic_type.cpp[tag=content] +---- -include::example$snippets/errors_missing_class_call.cpp[tag=use,indent=0] +A custom cpp:rtti[] policy that reports a class as polymorphic must also be +able to find the dynamic type of its objects. Give it a `dynamic_type` +function, or make `is_polymorphic` false for that class. See +xref:custom_rtti.adoc[Custom RTTI]. + +#### `the rtti policy does not deem this class polymorphic` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_rtti_not_polymorphic.cpp[tag=content] ---- -### Missing base classes +The converse. The library never asks for the dynamic type of a class that its +rtti policy does not deem polymorphic, so this message only comes from code +that calls the vptr policy directly, or from a custom `virtual_traits`. -`initialize` learns about inheritance relationships from the class -registrations: each lists a class together with its direct bases. Two classes -that are registered separately are unrelated, as far as OpenMethod is -concerned. If an overrider implies that one derives from the other, -`initialize` reports it: +### Registries + +See xref:registries_and_policies.adoc#registry_affinity[Registry Affinity] for +how a class, a parameter and a method come to belong to a registry. + +[#registry_mismatch] +#### `registry mismatch` [source,c++] ---- -include::example$snippets/errors_missing_base.cpp[tag=classes] +include::example$troubleshooting/compile_fail_registry_mismatch.cpp[tag=content] +---- -include::example$snippets/errors_missing_base.cpp[tag=init,indent=0] +A `virtual_ptr`, an overrider or a `virtual_any` belongs to a registry other +than the method's. Here, `virtual_ptr` belongs to the default registry, +and the method to `my_registry`. Write `virtual_ptr`, or +declare an affinity for `my_registry` in `Node`. + +#### `registry mismatch: the parameter belongs to another registry` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_registry_mismatch_parameter.cpp[tag=content] ---- -The message names the base class first, then the derived class. The fix is to -register the classes together: +The class of a virtual parameter declares an affinity for a registry, or the +parameter names one, and the method names another. + +#### `registry mismatch: a class declares an affinity for another registry` [source,c++] ---- -include::example$snippets/errors_missing_class_call.cpp[tag=fix] +include::example$troubleshooting/compile_fail_registry_mismatch_classes.cpp[tag=content] ---- -### Calls that cannot be dispatched +A class list names a registry, and one of the classes declares an affinity for +another. -A call reports `not implemented` if no overrider is applicable to the dynamic -types of its virtual arguments, and `ambiguous` if several are, and none of -them is more specialized than all the others. See -xref:multiple_dispatch.adoc[Multiple Dispatch]. +#### `virtual parameters carry conflicting registries` -Neither is a mistake by itself: a method may well be meant for some -combinations of classes only. However, cpp:initialize[] already knows about -every such combination, and says how many there are in its report. A program -can check it, and set the `BOOST_OPENMETHOD_TRACE` environment variable to -`1` to find out which methods and classes are involved: +[source,c++] +---- +include::example$troubleshooting/compile_fail_registry_conflicting_carriers.cpp[tag=content] +---- + +The method names no registry, and its virtual parameters belong to different +ones: `Node` to the default registry, `Expr` to `my_registry`. Name the +registry on the method, or make the parameters agree. + +#### `the classes carry conflicting registry affinities - list the registry to say which one is meant` [source,c++] ---- -include::example$snippets/initialize.cpp[tag=report,indent=0] +include::example$troubleshooting/compile_fail_registry_conflicting_affinities.cpp[tag=content] ---- -The trace lists the classes, the methods, their overriders and the dispatch -tables that `initialize` builds from them. Its format is not specified, and -may change from one version to the next. +A class list mixes classes that declare different affinities, or, as here, +classes that declare one with classes that declare none. Add the registry at +the end of the list. -## Message index +#### `cannot tell which registry this class belongs to...` -Each table quotes enough of a message to search for. Where a diagnostic is not -a `static_assert`, the wording depends on the compiler, and the table quotes -gcc. +[source,c++] +---- +include::example$troubleshooting/compile_fail_registry_ambiguous_bases.cpp[tag=content] +---- -### Methods and overriders +The class inherits different affinities from several bases, or inherits one +from a private base. Declare its affinity in the class itself. -[cols="2,3"] -|=== -| Message | Cause and remedy +#### `boost_openmethod_registry must return a registry` -| `cannot find '...' method that accepts the same arguments as the overrider` -| See <<_the_overrider_matches_no_method>> above. +[source,c++] +---- +include::example$troubleshooting/compile_fail_registry_not_a_registry.cpp[tag=content] +---- -| `BOOST_OPENMETHOD_OVERRIDE: the overrider does not match the method` -| The overrider was matched to a method, but one of its parameters is not - acceptable. It is accompanied by a more specific message, such as - `registry mismatch`. +The affinity declaration names a type that is not a registry. -| `method has no virtual parameters` -| A method needs at least one parameter declared with `virtual_` or - `virtual_ptr`. Without one, it is an ordinary function. +#### `this class declared its registry affinity after it was first mentioned...` -| `virtual_<> parameter is not a polymorphic class` -| See <<_the_class_is_not_polymorphic>> above. +[source,c++] +---- +include::example$troubleshooting/compile_fail_registry_declared_late.cpp[tag=content] +---- -| `virtual_traits not specialized for type` -| A `virtual_` parameter must be a reference (or a pointer, or a smart pointer - that OpenMethod supports): `virtual_`, not `virtual_`. +`virtual_ptr` was formed - here, inside `Expr` itself - before the +affinity declaration was seen, and kept the default registry. Move the +declaration up, to the top of the class, or name the registry where the class +is first used: `virtual_ptr`. -| `virtual_<> is not allowed in overriders` -| An overrider takes the plain type: `Plus&` where the method takes - `virtual_`. +### Smart pointers -| `virtual_ptr<> is required in overrider in same position as in method` -| Where the method takes a `virtual_ptr`, the overrider must take one too. +#### `std::shared_ptr cannot be passed by non-const lvalue reference` -| `different virtual_ptr<> reference categories` -| A `virtual_ptr` parameter is passed by value in the method and by reference - in the overrider, or vice versa. Use the same form in both. +[source,c++] +---- +include::example$troubleshooting/compile_fail_shared_ptr_by_reference.cpp[tag=content] +---- -| `overrider parameter discards const qualifier` -| See <<_the_overrider_discards_const>> above. +Pass a `std::shared_ptr`, or a `shared_virtual_ptr`, by value or by const +reference. -| `overrider return type is not convertible to method return type` -| The overrider returns the method's return type, or a type that converts to - it, such as `Plus*` for `Node*`. If the method returns `void`, so does the - overrider. +#### `cast only allowed to a shared_ptr` -| `different virtual_ptr<> pointer kinds` -| A `virtual_ptr` holds a plain pointer in the method and a smart pointer in - the overrider. Use the same kind in both: `virtual_ptr` for - `virtual_ptr`, `shared_virtual_ptr` for - `shared_virtual_ptr`. +[source,c++] +---- +include::example$troubleshooting/compile_fail_shared_ptr_overrider.cpp[tag=content] +---- -| `virtual_ptr category mismatch` -| Follows one of the two messages above, from the code that calls the - overrider. Fix the first one. +The method takes a `std::shared_ptr`, and the overrider something else in the +same position: here, a non-const reference. It takes a `std::shared_ptr` too, +in the same form: `const std::shared_ptr&`. -| `non-virtual parameter types must match exactly` -| The non-virtual parameters of the overrider must have the same types as the - method's. +#### `a std::weak_ptr cannot be wrapped in a virtual_ptr; use weak_virtual_ptr` -| `method parameter must be an unambiguous accessible base of corresponding overrider parameter` -| The same mistake as in <<_the_overrider_matches_no_method>>, detected by the - core API rather than by the macro. -|=== +[source,c++] +---- +include::example$troubleshooting/compile_fail_weak_ptr_in_virtual_ptr.cpp[tag=content] +---- -### Classes +Use cpp:weak_virtual_ptr[] to keep a weak reference together with its v-table +pointer. -[cols="2,3"] -|=== -| Message | Cause and remedy +#### `a weak pointer cannot be a virtual parameter; call lock() first` -| `class must be an accessible unambiguous base, repeated inheritance is not supported` -| A class inherits the same base more than once, without virtual inheritance. - OpenMethod cannot convert a pointer to the derived class to a pointer to that - base. +[source,c++] +---- +include::example$troubleshooting/compile_fail_method_takes_weak_pointer.cpp[tag=content] +---- -| `use_classes: a class is incomplete` -| A class is registered where it is only declared. Register it after its - definition. +A method cannot dispatch on an object that may no longer exist. Lock the +pointer, and pass the resulting shared pointer. -| `a registry must be the last element of the list` -| A class list names its registry last: - `BOOST_OPENMETHOD_CLASSES(Animal, Dog, my_registry)`. -|=== +### `any` and type erasure -### Virtual pointers and smart pointers +See xref:interop_any.adoc[Interoperation with any] and +xref:interop_type_erasure.adoc[Interoperation with Boost.TypeErasure]. -[cols="2,3"] -|=== -| Message | Cause and remedy +#### `requires standard RTTI` -| `no matching function for call to ‘boost::openmethod::virtual_ptr<_C_>::virtual_ptr(_C_&)’` -| The class is not polymorphic, so `virtual_ptr` cannot find its dynamic type. - See <<_the_class_is_not_polymorphic>>. +[source,c++] +---- +include::example$troubleshooting/compile_fail_any_custom_rtti.cpp[tag=content] +---- -| `do not wrap an object that has a boost_openmethod_vptr overload in a virtual_ptr` -| The object carries its own v-table pointer, for example because it derives - from cpp:inplace_vptr_base[]. Pass the object itself to methods. +Dispatching on the content of an `any` keys on its `std::type_info`, so the +registry uses cpp:std_rtti[], or a policy derived from it. -| `class must inherit from inplace_vptr_base` -| A base class passed to `inplace_vptr_derived` is not itself an - `inplace_vptr` class. +#### `virtual_any must be passed by reference` -| `registry can be specified only for root classes` -| Only the root of an `inplace_vptr` hierarchy names the registry; its derived - classes inherit it. +[source,c++] +---- +include::example$troubleshooting/compile_fail_method_takes_virtual_any_by_value.cpp[tag=content] +---- -| `virtual_ptr<> takes a class or a smart pointer: virtual_ptr, not virtual_ptr` -| `virtual_ptr` is a pointer already. Its argument is the class itself, or a - smart pointer to it. +A `virtual_any` passed by value would copy the `any`, and its content, on every +call. Write `virtual_std_any&` or `const virtual_std_any&`. -| `virtual_ptr<> must be passed by value 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&`. +#### `an owning type_erasure::any must be passed by reference` -| `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 - reference. +[source,c++] +---- +include::example$troubleshooting/compile_fail_method_takes_erased_by_value.cpp[tag=content] +---- -| `cast only allowed to a shared_ptr` -| The method takes a `std::shared_ptr`, and the overrider takes something - else in the same position. It must take a `std::shared_ptr` too. +The same, for a Boost.TypeErasure `any` that owns its value. The reference +forms, `any` and `any`, may be passed by value. -| `a std::weak_ptr cannot be wrapped in a virtual_ptr; use weak_virtual_ptr` -| Use cpp:weak_virtual_ptr[] to keep a weak reference together with its - v-table pointer. +#### `do not wrap a virtual_any in a virtual_ptr...` -| `a weak pointer cannot be a virtual parameter; call lock() first` -| A method cannot dispatch on an object that may no longer exist. Lock the - pointer, and pass the resulting shared pointer. -|=== +[source,c++] +---- +include::example$troubleshooting/compile_fail_wrap_virtual_any.cpp[tag=content] +---- -### Registries +A `virtual_any` already carries the v-table pointer of its content. Pass it by +reference instead. -See xref:registries_and_policies.adoc#registry_affinity[Registry Affinity] for -how a class, a parameter and a method come to belong to a registry. +#### `use of deleted function ... final_virtual_ptr` -[cols="2,3"] -|=== -| Message | Cause and remedy - -| `registry mismatch` -| A `virtual_ptr`, an overrider or a `virtual_any` belongs to a registry - other than the method's. The rest of the message, if any, says which. - -| `registry mismatch: the parameter belongs to another registry` -| A virtual parameter names a registry, or its class declares an affinity for - one, and the method names another. - -| `registry mismatch: a class declares an affinity for another registry` -| A class list names a registry, and one of the classes declares an affinity - for another. - -| `virtual parameters carry conflicting registries` -| The virtual parameters of a method that names no registry belong to - different registries. Name the registry on the method, or make the - parameters agree. - -| `the classes carry conflicting registry affinities - list the registry to say which one is meant` -| A class list mixes classes that declare different affinities, or a class - that declares one with a class that declares none. Add the registry at the - end of the list. - -| `cannot tell which registry this class belongs to` -| The class inherits different affinities from several bases, or inherits one - from a private base. Declare its affinity in the class itself. - -| `boost_openmethod_registry must return a registry` -| The affinity declaration names a type that is not a registry. - -| `this class declared its registry affinity after it was first mentioned` -| A `virtual_ptr` of the class, or a method over it, was formed before the - affinity declaration was seen - through a forward declaration, or from - inside the class itself - and kept the default registry. Move the - declaration up, or name the registry where the class is first used. -|=== +[source,c++] +---- +include::example$troubleshooting/compile_fail_final_virtual_ptr_any.cpp[tag=content] +---- -### `any` and type erasure +cpp:final_virtual_ptr[] would use the v-table of the `any` class itself, not +that of its content, so the overloads for `any` types are deleted. Use a +`virtual_any` instead. Clang says `call to deleted function`, and MSVC +`attempting to reference a deleted function`. -See xref:interop_any.adoc[Interoperation with any] and -xref:interop_type_erasure.adoc[Interoperation with Boost.TypeErasure]. +#### `no matching function for call to ...cast` -[cols="2,3"] -|=== -| Message | Cause and remedy +[source,c++] +---- +include::example$troubleshooting/compile_fail_any_cast_mutable_reference.cpp[tag=content] +---- -| `requires standard RTTI` -| Dispatching on the content of an `any` keys on its `std::type_info`, so the - registry must use cpp:std_rtti[], or a policy derived from it. +The overrider takes the content of the `any` by a kind of reference that the +`any` cannot provide: a mutable reference to the content of a const `any`, as +here, or an rvalue reference to the content of an lvalue `any`. Take +`const Plus&`. MSVC says `no matching overloaded function found`. -| `virtual_any must be passed by reference` -| A `virtual_any` method parameter passed by value would copy the `any`, and - its content, on every call. +### Policies -| `an owning type_erasure::any must be passed by reference` -| The same, for a Boost.TypeErasure `any` that owns its value. The reference - forms, `any` and `any`, may be passed by value. +See xref:registries_and_policies.adoc[Registries and Policies]. -| `do not wrap a virtual_any in a virtual_ptr` -| A `virtual_any` already carries the v-table pointer of its content. Pass it - by reference instead. +#### `+the `state` of a policy that defines `initialize` must be copyable...+` -| `use of deleted function ‘void boost::openmethod::final_virtual_ptr(...)’` -| cpp:final_virtual_ptr[] would use the v-table of the `any` class itself, not - that of its content. Use a `virtual_any` instead. +[source,c++] +---- +include::example$troubleshooting/compile_fail_policy_state_not_copyable.cpp[tag=content] +---- -| `no matching function for call to ‘...::cast<...>(...)’` -| The overrider takes the content of the `any` by a kind of reference the - `any` cannot provide: a mutable reference to the content of a const `any`, - or an rvalue reference to the content of an lvalue `any`. -|=== +`initialize` saves the `state` of each policy that has an `initialize` +function, and restores it if another policy throws. A `std::unique_ptr` member +makes it impossible to copy: hold a `std::shared_ptr`, or a value. -### Policies +#### `+the `state` of a policy that defines `initialize` must be nothrow move-assignable...+` -[cols="2,3"] -|=== -| Message | Cause and remedy +[source,c++] +---- +include::example$troubleshooting/compile_fail_policy_state_move_may_throw.cpp[tag=content] +---- -| `must be copyable: initialize() saves it` -| The `state` of a policy that defines `initialize` must be copy-assignable: - `initialize` saves it, and restores it if another policy throws. +The state is restored from a destructor, while an exception is in flight, where +throwing would terminate the program. Declare the move assignment `noexcept`, +or let the compiler generate it. -| `must be nothrow move-assignable` -| The state is restored from a destructor, while an exception is in flight, - where throwing would terminate the program. +#### `two or more stateful policies in this registry share the same nested state type...` -| `two or more stateful policies in this registry share the same nested state type` -| Each stateful policy must define its own `state` type. +[source,c++] +---- +include::example$troubleshooting/compile_fail_policy_shared_state.cpp[tag=content] +---- -| `the type_hash policy must appear before vptr_vector in the registry's policy_list` -| `vptr_vector` uses the hash computed by the `type_hash` policy, so it must - come after it in the registry's policy list. +The registry keeps the states of its policies together, and finds each by its +type. Give each policy a `state` type of its own, for example a nested struct. -| `minimal_cover_hash needs BMI2` -| Compile every translation unit with `-mbmi2`, or with a `-march` that - implies it, or use cpp:minimal_perfect_hash[], which is portable. +#### `+the type_hash policy must appear before vptr_vector in the registry's policy_list+` -| `This implementation requires that size_t and void* have the same size.` -| The platform is not supported. -|=== +[source,c++] +---- +include::example$troubleshooting/compile_fail_policy_order.cpp[tag=content] +---- + +`vptr_vector` uses the hash computed by the `type_hash` policy, so it comes +after it in the registry's policy list. `with` replaces a policy in place, so +`default_registry::with` keeps the right order. +`without` followed by `with` appends the policy at the end. + +#### `minimal_cover_hash needs BMI2...` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_minimal_cover_hash_without_bmi2.cpp[tag=content] +---- + +cpp:minimal_cover_hash[] uses the x86-64 `PEXT` instruction. Compile every +translation unit with `-mbmi2`, or with a `-march` that implies it, or use +cpp:minimal_perfect_hash[], which is portable. MSVC does not report the error +for x64 builds: it compiles the instruction whatever the flags, so the program +requires a processor that supports it. ### C++26 reflection -[cols="2,3"] -|=== -| Message | Cause and remedy +The examples need a compiler that supports reflection, such as GCC 16 with +`-std=c++26 -freflection`. -| `order the groups as namespaces, classes, registries` -| The groups passed to `register_classes` are out of order. +#### `a group holds reflections of namespaces, classes or registries` -| `a group holds one kind of reflection` -| Put the namespaces, the classes and the registries in groups of their own. +[source,c++] +---- +include::example$troubleshooting/compile_fail_register_classes_not_a_class.cpp[tag=content] +---- -| `a group holds reflections of namespaces, classes or registries` -| A group contains a reflection of something else, such as a function. +A group passed to `register_classes` contains a reflection of something else, +such as a fundamental type, an enumeration or a function. -| `a listed class must be complete` -| A class listed explicitly is only declared, not defined. -|=== +#### `a group holds one kind of reflection...` -### Runtime messages +[source,c++] +---- +include::example$troubleshooting/compile_fail_register_classes_mixed_group.cpp[tag=content] +---- -Each message is written by the default error handler. The second column names -the error type that a custom handler receives. +Put the namespaces, the classes and the registries in groups of their own: +`register_classes<{^^Node, ^^Plus}, {^^my_registry}>`. -[cols="2,1,3"] -|=== -| Message | Error | Cause and remedy +#### `order the groups as namespaces, classes, registries` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_register_classes_group_order.cpp[tag=content] +---- + +The groups passed to `register_classes` are out of order. + +#### `a listed class must be complete` + +[source,c++] +---- +include::example$troubleshooting/compile_fail_register_classes_incomplete.cpp[tag=content] +---- + +A class listed explicitly is only declared, not defined. + +### Platform + +These two do not depend on the program, so they come without an example. + +#### `This implementation requires that size_t and void* have the same size.` + +The platform is not supported. No x86, x86-64, ARM or AArch64 target is +affected. + +#### `+named_static_rtti requires __PRETTY_FUNCTION__ or __FUNCSIG__+` + +cpp:named_static_rtti[] derives class names from the predefined function name +of GCC, Clang or MSVC, and the compiler provides neither. + +## Runtime errors + +Errors detected at run time are passed to the registry's +cpp:error_handler[] policy. The one in cpp:default_registry[] writes the +message to `stderr`, then the program is terminated with `abort`. +xref:error_handling.adoc[Error Handling] explains how to change that, for +example to throw an exception. Each section below names the error type that a +custom handler receives. + +cpp:initialize[] always checks the classes, methods and overriders it is given, +and a call that finds no overrider, or several ambiguous ones, is always +reported. The other checks made during a call - for an unregistered class, a +call before `initialize`, a misused cpp:final_virtual_ptr[] - are made only if +the registry contains the cpp:runtime_checks[] policy. `default_registry` +contains it if +xref:reference:BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS.adoc[BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS] +is defined, which is recommended in debug builds. + +### Registration + +#### `unknown class _C_` + +Error type: cpp:missing_class[]. + +Every class that appears in a virtual parameter, in a method or in an +overrider, must be registered with +xref:reference:BOOST_OPENMETHOD_CLASSES.adoc[BOOST_OPENMETHOD_CLASSES]. So must +the class of every object passed as a virtual argument. cpp:initialize[] +detects the first two omissions: + +[source,c++] +---- +include::example$snippets/errors_missing_class_method.cpp[tag=classes] + +include::example$snippets/errors_missing_class_method.cpp[tag=init,indent=0] +---- + +[source,c++] +---- +include::example$snippets/errors_missing_class_overrider.cpp[tag=classes] + +include::example$snippets/errors_missing_class_overrider.cpp[tag=init,indent=0] +---- + +The third one can be detected only during the call, and only if runtime checks +are enabled. Otherwise, the call reads a v-table pointer that was never set up, +and the behavior is undefined: it may call the wrong overrider, or crash. + +[source,c++] +---- +include::example$snippets/errors_missing_class_call.cpp[tag=classes] + +include::example$snippets/errors_missing_class_call.cpp[tag=use,indent=0] +---- + +#### `missing base _B_ -<| _D_` + +Error type: cpp:missing_base[]. + +`initialize` learns about inheritance relationships from the class +registrations: each lists a class together with its direct bases. Two classes +that are registered separately are unrelated, as far as OpenMethod is +concerned. If an overrider implies that one derives from the other, +`initialize` reports it: + +[source,c++] +---- +include::example$snippets/errors_missing_base.cpp[tag=classes] + +include::example$snippets/errors_missing_base.cpp[tag=init,indent=0] +---- + +The message names the base class first, then the derived class. The fix is to +register the classes together: + +[source,c++] +---- +include::example$snippets/errors_missing_class_call.cpp[tag=fix] +---- + +### Dispatch + +#### `not implemented` + +Error type: cpp:no_overrider[]. + +No overrider is applicable to the dynamic types of the virtual arguments: + +[source,c++] +---- +include::example$snippets/errors_not_implemented.cpp[tag=classes] + +include::example$snippets/errors_not_implemented.cpp[tag=use,indent=0] +---- + +This is not a mistake by itself: a method may well be meant for some classes +only. Either add an overrider for `Cat`, or one for `Animal` that serves as a +default. See <> to find out, at +`initialize` time, whether any call can end like this. + +#### `ambiguous` + +Error type: cpp:ambiguous_call[]. + +Several overriders are applicable, and none of them is more specialized than +all the others: + +[source,c++] +---- +include::example$snippets/errors_ambiguous.cpp[tag=classes] + +include::example$snippets/errors_ambiguous.cpp[tag=use,indent=0] +---- + +Both overriders accept two `Dog`{empty}s, and each is more specialized than +the other in one argument. Add an overrider for `(Dog, Dog)`. See +xref:multiple_dispatch.adoc[Multiple Dispatch]. + +[#finding_undispatchable_calls] +#### Finding the calls that cannot be dispatched + +cpp:initialize[] already knows about every combination of classes that ends +in `not implemented` or `ambiguous`, and says how many there are in its +report. A program can check it, and set the `BOOST_OPENMETHOD_TRACE` +environment variable to `1` to find out which methods and classes are +involved: + +[source,c++] +---- +include::example$snippets/initialize.cpp[tag=report,indent=0] +---- + +The trace lists the classes, the methods, their overriders and the dispatch +tables that `initialize` builds from them. Its format is not specified, and +may change from one version to the next. + +### Calls + +#### `not initialized` + +Error type: cpp:not_initialized[]. + +A method was called before cpp:initialize[]: + +[source,c++] +---- +include::example$snippets/errors_not_initialized.cpp[tag=classes] + +include::example$snippets/errors_not_initialized.cpp[tag=use,indent=0] +---- + +This is detected only with runtime checks; otherwise, the behavior is +undefined. Call `initialize` before the first method call, typically at the +start of `main`. A shared library loaded at run time adds classes, methods and +overriders, so call it again after loading one. See +xref:shared_libraries.adoc[Shared Libraries]. + +#### `invalid call to final construct: static type = _S_, dynamic type = _D_` -| `unknown class _C_` -| cpp:missing_class[] -| See <<_missing_class_registrations>>. +Error type: cpp:final_error[]. -| `missing base _B_ -<\| _D_` -| cpp:missing_base[] -| See <<_missing_base_classes>>. +cpp:final_virtual_ptr[] takes the static type of its argument for its dynamic +type, without checking it, unless runtime checks are enabled: -| `not implemented` -| cpp:no_overrider[] -| See <<_calls_that_cannot_be_dispatched>>. +[source,c++] +---- +include::example$snippets/errors_final.cpp[tag=use,indent=0] +---- + +Pass `final_virtual_ptr` an object whose static type is exactly its dynamic +type - here, `snoopy` itself - or use cpp:virtual_ptr[], which finds the +dynamic type. -| `ambiguous` -| cpp:ambiguous_call[] -| See <<_calls_that_cannot_be_dispatched>>. +### Builds -| `not initialized` -| cpp:not_initialized[] -| A method was called before cpp:initialize[]. Detected only with runtime - checks; otherwise the behavior is undefined. +#### `conflicting definitions of _R_` -| `invalid call to final construct: static type = _S_, dynamic type = _D_` -| cpp:final_error[] -| cpp:final_virtual_ptr[] was given an object whose dynamic type is not its - static type. Detected only with runtime checks. +Error type: cpp:odr_violation[]. -| `conflicting definitions of _R_` -| cpp:odr_violation[] -| `BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS` is defined in some translation - units and not in others, so `default_registry` has several definitions. +`BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS` changes the definition of +`default_registry`, so it must be defined in all the translation units of the +program, or in none. When it is defined in some and not in others, +cpp:initialize[] reports it before anything else: + +[source,c++] +---- +include::example$snippets/errors_odr_violation.cpp[tag=init,indent=0] +---- + +Define the symbol in the build system, for every translation unit, rather than +in source files. + +### Hash tables + +The `type_hash` policy maps type ids to the indexes of the v-tables. Its +`initialize` searches for a function that does that for the registered classes, +and reports an error if it cannot find one. Each policy has its own: + +[cols="2,2"] +|=== +| Message | Policy | `could not find hash factors after _N_ attempts using up to _M_ buckets` -| `fast_perfect_hash::search_error` -| cpp:fast_perfect_hash[] could not build a collision-free table for the - registered type ids. Use another `type_hash` policy, such as - cpp:minimal_perfect_hash[]. +| cpp:fast_perfect_hash[], the default | `could not place _N_ type ids after trying _M_ multipliers` -| `minimal_perfect_hash::search_error` -| The same, for cpp:minimal_perfect_hash[]. +| cpp:minimal_perfect_hash[] | `+could not place N type ids in a table of up to 2^B slots+` -| `two_level_hash::search_error` -| The same, for cpp:two_level_hash[]. +| cpp:two_level_hash[] | `the smallest bit cover of _N_ type ids is _B_ bits wide, more than the _M_ allowed` -| `minimal_cover_hash::too_many_bits` -| Increase the limit, or use another `type_hash` policy. +| cpp:minimal_cover_hash[] |=== + +With the default limits, the first three are unlikely with ordinary type ids, +and cannot be provoked by a small program. The last two policies take their +limits as template arguments, so it takes a registry configured to fail: + +[source,c++] +---- +include::example$snippets/errors_hash_search.cpp[tag=classes] + +include::example$snippets/errors_hash_search.cpp[tag=init,indent=0] +---- + +[source,c++] +---- +include::example$snippets/errors_too_many_bits.cpp[tag=classes] + +include::example$snippets/errors_too_many_bits.cpp[tag=init,indent=0] +---- + +Raise the limit, or use another `type_hash` policy. The type ids that a policy +fails on usually come from a custom RTTI policy. See +xref:shared_libraries.adoc#type_ids_across_modules[Type ids across modules] for +how the policies compare. From 12726cab20a52c1ec194c4d11c9e8262bcc14f31 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leroy Date: Wed, 4 Nov 2026 18:42:52 -0500 Subject: [PATCH 2/6] doc: troubleshooting: make the examples pass with MSVC MSVC does not instantiate a method from its declaration alone, so three compile-fail examples compiled cleanly there. Call the method after the tagged region, as the tests in test/ do. MSVC also names a class `struct Animal` in error messages, so the final and ODR snippets strip the key before comparing. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr --- .../ROOT/examples/snippets/error_harness.hpp | 13 +++++++++++++ doc/modules/ROOT/examples/snippets/errors_final.cpp | 2 +- .../ROOT/examples/snippets/errors_odr_violation.cpp | 2 +- ...mpile_fail_method_takes_virtual_any_by_value.cpp | 5 +++++ .../compile_fail_registry_declared_late.cpp | 4 ++++ .../compile_fail_shared_ptr_by_reference.cpp | 4 ++++ 6 files changed, 28 insertions(+), 2 deletions(-) diff --git a/doc/modules/ROOT/examples/snippets/error_harness.hpp b/doc/modules/ROOT/examples/snippets/error_harness.hpp index 2df25f4f..891dead3 100644 --- a/doc/modules/ROOT/examples/snippets/error_harness.hpp +++ b/doc/modules/ROOT/examples/snippets/error_harness.hpp @@ -14,6 +14,7 @@ #define BOOST_OPENMETHOD_SNIPPETS_ERROR_HARNESS_HPP #include +#include #include #include "capture.hpp" @@ -44,4 +45,16 @@ auto reporting(F&& f) -> void { } } +// Removes the `struct ` that MSVC writes before a class name, where gcc and +// clang write the name alone. +inline auto without_struct_keys(std::string text) -> std::string { + for ( + auto pos = text.find("struct "); pos != std::string::npos; + pos = text.find("struct ", pos)) { + text.erase(pos, 7); + } + + return text; +} + #endif diff --git a/doc/modules/ROOT/examples/snippets/errors_final.cpp b/doc/modules/ROOT/examples/snippets/errors_final.cpp index 2194f3ec..40b1311a 100644 --- a/doc/modules/ROOT/examples/snippets/errors_final.cpp +++ b/doc/modules/ROOT/examples/snippets/errors_final.cpp @@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE(final_construct) { }); BOOST_TEST( - cerr.str() == + without_struct_keys(cerr.str()) == "invalid call to final construct: static type = Animal, dynamic type = " "Dog\n"); } diff --git a/doc/modules/ROOT/examples/snippets/errors_odr_violation.cpp b/doc/modules/ROOT/examples/snippets/errors_odr_violation.cpp index 9cb5c035..6869fbfb 100644 --- a/doc/modules/ROOT/examples/snippets/errors_odr_violation.cpp +++ b/doc/modules/ROOT/examples/snippets/errors_odr_violation.cpp @@ -29,6 +29,6 @@ BOOST_AUTO_TEST_CASE(conflicting_definitions) { }); BOOST_TEST( - cerr.str() == + without_struct_keys(cerr.str()) == "conflicting definitions of boost::openmethod::default_registry\n"); } diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_virtual_any_by_value.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_virtual_any_by_value.cpp index 3259e520..e442067b 100644 --- a/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_virtual_any_by_value.cpp +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_method_takes_virtual_any_by_value.cpp @@ -14,3 +14,8 @@ BOOST_OPENMETHOD(postfix, (virtual_std_any, std::ostream&), void); // end::content[] + +void call(Plus& plus) { + virtual_std_any node = plus; + postfix(node, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_declared_late.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_declared_late.cpp index a3a492b2..00f18ccf 100644 --- a/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_declared_late.cpp +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_registry_declared_late.cpp @@ -18,3 +18,7 @@ struct Expr { BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); // end::content[] + +void call(Expr& expr) { + postfix(expr, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_shared_ptr_by_reference.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_shared_ptr_by_reference.cpp index 585932b1..cbe22870 100644 --- a/doc/modules/ROOT/examples/troubleshooting/compile_fail_shared_ptr_by_reference.cpp +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_shared_ptr_by_reference.cpp @@ -14,3 +14,7 @@ BOOST_OPENMETHOD(postfix, (shared_virtual_ptr&, std::ostream&), void); // end::content[] + +void call(Plus& plus) { + postfix(plus, std::cout); +} From a59ea079649f43d8a204505b465d1d0c55c837be Mon Sep 17 00:00:00 2001 From: Jean-Louis Leroy Date: Sun, 8 Nov 2026 09:25:06 -0500 Subject: [PATCH 3/6] doc: troubleshooting: show the fix for each error Every entry now ends with a *Fix* listing that corrects its example. For a compile-time error the fix is troubleshooting/fix_.cpp, compiled as a test by test/CMakeLists.txt and test/Jamfile, so a fix that does not compile fails the build. For a runtime error it is snippets/fix_.cpp, a Boost.Test program that checks the call now succeeds silently. The page moves after the reference in the navigation. CLAUDE.md asks that every diagnostic keep an entry on the page, in the same change that adds, removes or rewords it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr --- CLAUDE.md | 12 + .../ROOT/examples/snippets/fix_ambiguous.cpp | 60 + .../ROOT/examples/snippets/fix_final.cpp | 56 + .../examples/snippets/fix_hash_search.cpp | 46 + .../examples/snippets/fix_missing_class.cpp | 57 + .../examples/snippets/fix_not_implemented.cpp | 57 + .../examples/snippets/fix_not_initialized.cpp | 55 + ...ompile_fail_any_cast_mutable_reference.cpp | 2 +- .../compile_fail_policy_order.cpp | 4 +- .../fix_any_cast_mutable_reference.cpp | 19 + .../troubleshooting/fix_any_custom_rtti.cpp | 19 + .../fix_call_non_polymorphic.cpp | 36 + .../fix_classes_forward_declared.cpp | 15 + .../fix_classes_registry_first.cpp | 13 + .../fix_core_overrider_private_base.cpp | 22 + .../fix_core_overrider_virtual.cpp | 18 + .../fix_diamond_inheritance.cpp | 17 + .../fix_final_virtual_ptr_any.cpp | 19 + .../fix_inplace_vptr_derived_not_base.cpp | 21 + .../fix_inplace_vptr_derived_registry.cpp | 17 + .../fix_method_takes_erased_by_value.cpp | 27 + .../fix_method_takes_virtual_any_by_value.cpp | 15 + .../fix_method_takes_weak_pointer.cpp | 22 + .../fix_no_virtual_parameters.cpp | 17 + .../fix_override_private_base.cpp | 20 + .../fix_overrider_discards_const.cpp | 18 + .../fix_overrider_parameter_type.cpp | 18 + .../fix_overrider_plain_reference.cpp | 18 + .../fix_overrider_reference_category.cpp | 18 + .../fix_overrider_returns_string.cpp | 17 + .../fix_overrider_smart_virtual_ptr.cpp | 18 + .../troubleshooting/fix_policy_order.cpp | 18 + .../fix_policy_shared_state.cpp | 38 + .../fix_policy_state_move_may_throw.cpp | 44 + .../fix_policy_state_not_copyable.cpp | 39 + .../fix_register_classes_group_order.cpp | 17 + .../fix_register_classes_incomplete.cpp | 19 + .../fix_register_classes_mixed_group.cpp | 17 + .../fix_register_classes_not_a_class.cpp | 17 + .../fix_registry_ambiguous_bases.cpp | 27 + .../fix_registry_conflicting_affinities.cpp | 19 + .../fix_registry_conflicting_carriers.cpp | 24 + .../fix_registry_declared_late.cpp | 19 + .../troubleshooting/fix_registry_mismatch.cpp | 19 + .../fix_registry_mismatch_classes.cpp | 20 + .../fix_registry_mismatch_parameter.cpp | 22 + .../fix_registry_not_a_registry.cpp | 18 + .../fix_rtti_not_polymorphic.cpp | 19 + .../fix_rtti_without_dynamic_type.cpp | 38 + .../fix_shared_ptr_by_reference.cpp | 15 + .../fix_shared_ptr_overrider.cpp | 21 + .../troubleshooting/fix_virtual_by_value.cpp | 17 + .../fix_virtual_non_polymorphic.cpp | 21 + .../fix_virtual_ptr_by_reference.cpp | 18 + .../fix_virtual_ptr_of_raw_pointer.cpp | 17 + .../fix_weak_ptr_in_virtual_ptr.cpp | 17 + .../troubleshooting/fix_wrap_inplace_vptr.cpp | 23 + .../troubleshooting/fix_wrap_virtual_any.cpp | 19 + doc/modules/ROOT/nav.adoc | 2 +- doc/modules/ROOT/pages/troubleshooting.adoc | 1044 +++++++++++++++-- test/CMakeLists.txt | 13 + test/Jamfile | 6 + 62 files changed, 2337 insertions(+), 103 deletions(-) create mode 100644 doc/modules/ROOT/examples/snippets/fix_ambiguous.cpp create mode 100644 doc/modules/ROOT/examples/snippets/fix_final.cpp create mode 100644 doc/modules/ROOT/examples/snippets/fix_hash_search.cpp create mode 100644 doc/modules/ROOT/examples/snippets/fix_missing_class.cpp create mode 100644 doc/modules/ROOT/examples/snippets/fix_not_implemented.cpp create mode 100644 doc/modules/ROOT/examples/snippets/fix_not_initialized.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_any_cast_mutable_reference.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_any_custom_rtti.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_call_non_polymorphic.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_classes_forward_declared.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_classes_registry_first.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_core_overrider_private_base.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_core_overrider_virtual.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_diamond_inheritance.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_final_virtual_ptr_any.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_inplace_vptr_derived_not_base.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_inplace_vptr_derived_registry.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_method_takes_erased_by_value.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_method_takes_virtual_any_by_value.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_method_takes_weak_pointer.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_no_virtual_parameters.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_override_private_base.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_overrider_discards_const.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_overrider_parameter_type.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_overrider_plain_reference.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_overrider_reference_category.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_overrider_returns_string.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_overrider_smart_virtual_ptr.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_policy_order.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_policy_shared_state.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_policy_state_move_may_throw.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_policy_state_not_copyable.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_register_classes_group_order.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_register_classes_incomplete.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_register_classes_mixed_group.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_register_classes_not_a_class.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_ambiguous_bases.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_affinities.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_carriers.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_declared_late.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_classes.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_parameter.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_not_a_registry.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_rtti_not_polymorphic.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_rtti_without_dynamic_type.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_shared_ptr_by_reference.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_shared_ptr_overrider.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_virtual_by_value.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_virtual_non_polymorphic.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_virtual_ptr_by_reference.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_virtual_ptr_of_raw_pointer.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_weak_ptr_in_virtual_ptr.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_wrap_inplace_vptr.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_wrap_virtual_any.cpp diff --git a/CLAUDE.md b/CLAUDE.md index 17f41a3b..71e700d7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -104,6 +104,18 @@ sit in a subdirectory because `doc/modules/ROOT/examples/CMakeLists.txt` builds `*.cpp` as an ordinary example. Match a gcc curly quote (`‘postfix’`) with `.*`, not `.`: it is three bytes, and the regex works on bytes. +**Every diagnostic the library emits has an entry on the troubleshooting page, so update the page +whenever an error is added, removed or reworded.** That covers a `static_assert` message, a runtime +error and its default-handler message alike. Do it in the same change: add, delete or retitle the +`####` entry in `doc/modules/ROOT/pages/troubleshooting.adoc` whose heading quotes the message. A +new entry takes the shape of its neighbours: an `*Example*` that reproduces the error, the cause, +then a `*Fix*` that corrects it. For a compile-time error the two listings are +`troubleshooting/compile_fail_.cpp`, with its `expected-error` marker, and +`troubleshooting/fix_.cpp`, which `test/CMakeLists.txt` and `test/Jamfile` compile as a test. +For a runtime error they are Boost.Test programs, `snippets/errors_.cpp` and +`snippets/fix_.cpp`. Nothing checks that the page lists every message: a removed error leaves +a stale entry, and an added one is simply missing. + The tested sources behind the reference's `include:` markers live in `doc/modules/ROOT/examples/snippets/`, inside Antora's `examples` family, so that pages can include them too (`include::example$snippets/...`). Antora ignores any directory of a module that is not diff --git a/doc/modules/ROOT/examples/snippets/fix_ambiguous.cpp b/doc/modules/ROOT/examples/snippets/fix_ambiguous.cpp new file mode 100644 index 00000000..e430dfb7 --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/fix_ambiguous.cpp @@ -0,0 +1,60 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for errors_ambiguous.cpp. + +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +using namespace boost::openmethod; + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; + +// tag::classes[] +BOOST_OPENMETHOD_CLASSES(Animal, Dog); + +BOOST_OPENMETHOD(meet, (virtual_ptr, virtual_ptr), void); + +BOOST_OPENMETHOD_OVERRIDE(meet, (virtual_ptr, virtual_ptr), void) { + // ... +} + +BOOST_OPENMETHOD_OVERRIDE(meet, (virtual_ptr, virtual_ptr), void) { + // ... +} + +BOOST_OPENMETHOD_OVERRIDE(meet, (virtual_ptr, virtual_ptr), void) { + // ... +} +// end::classes[] + +BOOST_AUTO_TEST_CASE(tie_breaker) { + auto report = initialize().report; + BOOST_TEST(report.ambiguous == 0u); + + capture_cerr cerr; + report_on_cerr(); + auto returned = false; + + reporting([&] { + // tag::use[] + Dog snoopy, hector; + meet(snoopy, hector); + // end::use[] + + returned = true; + }); + + BOOST_TEST(returned); + BOOST_TEST(cerr.str().empty()); +} diff --git a/doc/modules/ROOT/examples/snippets/fix_final.cpp b/doc/modules/ROOT/examples/snippets/fix_final.cpp new file mode 100644 index 00000000..710436fc --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/fix_final.cpp @@ -0,0 +1,56 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for errors_final.cpp. Runtime +// checks are on, so that a misused final_virtual_ptr would be reported. +#ifndef BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#define BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#endif + +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +using namespace boost::openmethod; + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; + +BOOST_OPENMETHOD_CLASSES(Animal, Dog); + +BOOST_OPENMETHOD(poke, (virtual_ptr), void); + +BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr), void) { + // ... +} + +BOOST_AUTO_TEST_CASE(final_construct) { + initialize(); + + capture_cerr cerr; + report_on_cerr(); + auto returned = false; + + reporting([&] { + // tag::use[] + Dog snoopy; + Animal& animal = snoopy; + + poke(final_virtual_ptr(snoopy)); + poke(virtual_ptr(animal)); + // end::use[] + + returned = true; + }); + + BOOST_TEST(returned); + BOOST_TEST(cerr.str().empty()); +} diff --git a/doc/modules/ROOT/examples/snippets/fix_hash_search.cpp b/doc/modules/ROOT/examples/snippets/fix_hash_search.cpp new file mode 100644 index 00000000..19fce5c7 --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/fix_hash_search.cpp @@ -0,0 +1,46 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for errors_hash_search.cpp. + +#include +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +using namespace boost::openmethod; + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; + +// tag::classes[] +struct hashed_registry : + default_registry::with> {}; + +BOOST_OPENMETHOD_CLASSES(Animal, Dog, hashed_registry); +// end::classes[] + +BOOST_AUTO_TEST_CASE(search_succeeds) { + capture_cerr cerr; + report_on_cerr(); + auto returned = false; + + reporting([&] { + // tag::init[] + initialize(); + // end::init[] + + returned = true; + }); + + BOOST_TEST(returned); + BOOST_TEST(cerr.str().empty()); +} diff --git a/doc/modules/ROOT/examples/snippets/fix_missing_class.cpp b/doc/modules/ROOT/examples/snippets/fix_missing_class.cpp new file mode 100644 index 00000000..5ac94bbe --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/fix_missing_class.cpp @@ -0,0 +1,57 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for the errors_missing_class_* +// snippets. Runtime checks are on, so that an unregistered class in the call +// would be reported. +#ifndef BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#define BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#endif + +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +using namespace boost::openmethod; + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; +struct Bulldog : Dog {}; + +// tag::classes[] +BOOST_OPENMETHOD_CLASSES(Animal, Dog, Bulldog); + +BOOST_OPENMETHOD(poke, (virtual_ptr), void); + +BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr), void) { + // ... +} +// end::classes[] + +BOOST_AUTO_TEST_CASE(all_classes_registered) { + initialize(); + + capture_cerr cerr; + report_on_cerr(); + auto returned = false; + + reporting([&] { + // tag::use[] + Bulldog hector; + poke(hector); + // end::use[] + + returned = true; + }); + + BOOST_TEST(returned); + BOOST_TEST(cerr.str().empty()); +} diff --git a/doc/modules/ROOT/examples/snippets/fix_not_implemented.cpp b/doc/modules/ROOT/examples/snippets/fix_not_implemented.cpp new file mode 100644 index 00000000..c7aa056b --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/fix_not_implemented.cpp @@ -0,0 +1,57 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for errors_not_implemented.cpp. + +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +using namespace boost::openmethod; + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; +struct Cat : Animal {}; + +// tag::classes[] +BOOST_OPENMETHOD_CLASSES(Animal, Dog, Cat); + +BOOST_OPENMETHOD(poke, (virtual_ptr), void); + +BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr), void) { + // ... +} + +BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr), void) { + // ... +} +// end::classes[] + +BOOST_AUTO_TEST_CASE(default_overrider) { + auto report = initialize().report; + BOOST_TEST(report.not_implemented == 0u); + + capture_cerr cerr; + report_on_cerr(); + auto returned = false; + + reporting([&] { + // tag::use[] + Cat felix; + poke(felix); + // end::use[] + + returned = true; + }); + + BOOST_TEST(returned); + BOOST_TEST(cerr.str().empty()); +} diff --git a/doc/modules/ROOT/examples/snippets/fix_not_initialized.cpp b/doc/modules/ROOT/examples/snippets/fix_not_initialized.cpp new file mode 100644 index 00000000..bb8d2b1d --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/fix_not_initialized.cpp @@ -0,0 +1,55 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for errors_not_initialized.cpp. +// Runtime checks are on, so that a call before initialize() would be reported. +#ifndef BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#define BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS +#endif + +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +using namespace boost::openmethod; + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; + +// tag::classes[] +BOOST_OPENMETHOD_CLASSES(Animal, Dog); + +BOOST_OPENMETHOD(poke, (virtual_ptr), void); + +BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr), void) { + // ... +} +// end::classes[] + +BOOST_AUTO_TEST_CASE(call_after_initialize) { + capture_cerr cerr; + report_on_cerr(); + auto returned = false; + + reporting([&] { + // tag::use[] + initialize(); + + Dog snoopy; + poke(snoopy); + // end::use[] + + returned = true; + }); + + BOOST_TEST(returned); + BOOST_TEST(cerr.str().empty()); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_any_cast_mutable_reference.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_any_cast_mutable_reference.cpp index 613c1dfd..890c2f45 100644 --- a/doc/modules/ROOT/examples/troubleshooting/compile_fail_any_cast_mutable_reference.cpp +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_any_cast_mutable_reference.cpp @@ -17,7 +17,7 @@ BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); -BOOST_OPENMETHOD_OVERRIDE(postfix, (Plus& plus, std::ostream& os), void) { +BOOST_OPENMETHOD_OVERRIDE(postfix, (Plus&, std::ostream& os), void) { os << "+"; } // end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_order.cpp b/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_order.cpp index 94a1b99d..65b7c3bf 100644 --- a/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_order.cpp +++ b/doc/modules/ROOT/examples/troubleshooting/compile_fail_policy_order.cpp @@ -10,9 +10,11 @@ #include "preamble.hpp" // tag::content[] +#include + struct hashed_registry : default_registry::without::with< - policies::fast_perfect_hash> {}; + policies::minimal_perfect_hash<>> {}; BOOST_OPENMETHOD_CLASSES(Node, Plus, hashed_registry); // end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_any_cast_mutable_reference.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_any_cast_mutable_reference.cpp new file mode 100644 index 00000000..0a74dc64 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_any_cast_mutable_reference.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_any_cast_mutable_reference.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE(postfix, (const Plus&, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_any_custom_rtti.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_any_custom_rtti.cpp new file mode 100644 index 00000000..cd6498f8 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_any_custom_rtti.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_any_custom_rtti.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); +// end::content[] + +void call(const std::any& node) { + postfix(node, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_call_non_polymorphic.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_call_non_polymorphic.cpp new file mode 100644 index 00000000..b129bcf7 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_call_non_polymorphic.cpp @@ -0,0 +1,36 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_call_non_polymorphic.cpp, +// and compiled as a test. + +// tag::content[] +#include + +#include +#include + +using boost::openmethod::virtual_ptr; + +struct Node { + virtual ~Node() = default; +}; + +struct Plus : Node {}; + +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (virtual_ptr, std::ostream& os), void) { + os << "+"; +} + +int main() { + boost::openmethod::initialize(); + + Plus plus; + postfix(plus, std::cout); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_classes_forward_declared.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_classes_forward_declared.cpp new file mode 100644 index 00000000..2f0f31c2 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_classes_forward_declared.cpp @@ -0,0 +1,15 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_classes_forward_declared.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Minus : Node {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, Minus); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_classes_registry_first.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_classes_registry_first.cpp new file mode 100644 index 00000000..9fe619d3 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_classes_registry_first.cpp @@ -0,0 +1,13 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_classes_registry_first.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD_CLASSES(Node, Plus, my_registry); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_core_overrider_private_base.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_core_overrider_private_base.cpp new file mode 100644 index 00000000..49120ac6 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_core_overrider_private_base.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_core_overrider_private_base.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +class Minus : public Node {}; + +struct postfix_id; +using postfix = method, std::ostream&)>; + +void postfix_minus(virtual_ptr, std::ostream& os) { + os << "-"; +} + +BOOST_OPENMETHOD_REGISTER(postfix::override); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_core_overrider_virtual.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_core_overrider_virtual.cpp new file mode 100644 index 00000000..39d9e3fa --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_core_overrider_virtual.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_core_overrider_virtual.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct postfix_id; +using postfix = method, std::ostream&)>; + +void postfix_plus(Plus&, std::ostream&); + +BOOST_OPENMETHOD_REGISTER(postfix::override); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_diamond_inheritance.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_diamond_inheritance.cpp new file mode 100644 index 00000000..d79ece57 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_diamond_inheritance.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_diamond_inheritance.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Left : virtual Node {}; +struct Right : virtual Node {}; +struct Both : Left, Right {}; + +BOOST_OPENMETHOD_CLASSES(Node, Left, Right, Both); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_final_virtual_ptr_any.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_final_virtual_ptr_any.cpp new file mode 100644 index 00000000..3b04769e --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_final_virtual_ptr_any.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_final_virtual_ptr_any.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (virtual_std_any&, std::ostream&), void); + +void print(virtual_std_any& node) { + postfix(node, std::cout); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_inplace_vptr_derived_not_base.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_inplace_vptr_derived_not_base.cpp new file mode 100644 index 00000000..c730ae36 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_inplace_vptr_derived_not_base.cpp @@ -0,0 +1,21 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_inplace_vptr_derived_not_base.cpp, +// and compiled as a test. + +#include + +using namespace boost::openmethod; + +// tag::content[] +#include + +struct Node : inplace_vptr_base { + virtual ~Node() = default; +}; + +struct Minus : Node, inplace_vptr_derived {}; +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_inplace_vptr_derived_registry.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_inplace_vptr_derived_registry.cpp new file mode 100644 index 00000000..92d61820 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_inplace_vptr_derived_registry.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_inplace_vptr_derived_registry.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +struct Term : inplace_vptr_base {}; + +struct Sum : Term, inplace_vptr_derived {}; +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_erased_by_value.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_erased_by_value.cpp new file mode 100644 index 00000000..8ebcce6d --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_erased_by_value.cpp @@ -0,0 +1,27 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_method_takes_erased_by_value.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include +#include +#include +#include + +namespace te = boost::type_erasure; + +using any_node = + te::any, te::relaxed>>; + +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); +// end::content[] + +void call(const any_node& node) { + postfix(node, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_virtual_any_by_value.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_virtual_any_by_value.cpp new file mode 100644 index 00000000..4a0061e2 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_virtual_any_by_value.cpp @@ -0,0 +1,15 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_method_takes_virtual_any_by_value.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (const virtual_std_any&, std::ostream&), void); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_weak_pointer.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_weak_pointer.cpp new file mode 100644 index 00000000..e44db2fe --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_weak_pointer.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_method_takes_weak_pointer.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD( + postfix, (virtual_>, std::ostream&), void); + +void call(const std::weak_ptr& node) { + if (auto locked = node.lock()) { + postfix(locked, std::cout); + } +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_no_virtual_parameters.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_no_virtual_parameters.cpp new file mode 100644 index 00000000..e674ecfd --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_no_virtual_parameters.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_no_virtual_parameters.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); +// end::content[] + +void call(Plus& plus) { + postfix(plus, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_override_private_base.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_override_private_base.cpp new file mode 100644 index 00000000..c017f01c --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_override_private_base.cpp @@ -0,0 +1,20 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_override_private_base.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +class Minus : public Node {}; + +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (virtual_ptr, std::ostream& os), void) { + os << "-"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_overrider_discards_const.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_discards_const.cpp new file mode 100644 index 00000000..ae9499db --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_discards_const.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_overrider_discards_const.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (virtual_ptr, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_overrider_parameter_type.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_parameter_type.cpp new file mode 100644 index 00000000..e2f828e4 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_parameter_type.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_overrider_parameter_type.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (virtual_ptr, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_overrider_plain_reference.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_plain_reference.cpp new file mode 100644 index 00000000..2fbdc9df --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_plain_reference.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_overrider_plain_reference.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (virtual_ptr, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_overrider_reference_category.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_reference_category.cpp new file mode 100644 index 00000000..9853e3a6 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_reference_category.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_overrider_reference_category.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (virtual_ptr, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_overrider_returns_string.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_returns_string.cpp new file mode 100644 index 00000000..930dfa7b --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_returns_string.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_overrider_returns_string.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(value, (virtual_ptr), int); + +BOOST_OPENMETHOD_OVERRIDE(value, (virtual_ptr), int) { + return 0; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_overrider_smart_virtual_ptr.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_smart_virtual_ptr.cpp new file mode 100644 index 00000000..fd584814 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_smart_virtual_ptr.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_overrider_smart_virtual_ptr.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (virtual_ptr, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_policy_order.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_policy_order.cpp new file mode 100644 index 00000000..bc0c12d9 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_policy_order.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_policy_order.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +struct hashed_registry : + default_registry::with> {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, hashed_registry); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_policy_shared_state.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_policy_shared_state.cpp new file mode 100644 index 00000000..2f6f50fc --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_policy_shared_state.cpp @@ -0,0 +1,38 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_policy_shared_state.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct counter { + int n = 0; +}; + +struct calls_policy { + using category = calls_policy; + + template + struct fn { + struct state : counter {}; + }; +}; + +struct errors_policy { + using category = errors_policy; + + template + struct fn { + struct state : counter {}; + }; +}; + +struct counting_registry : + default_registry::with {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, counting_registry); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_policy_state_move_may_throw.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_policy_state_move_may_throw.cpp new file mode 100644 index 00000000..74f522ea --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_policy_state_move_may_throw.cpp @@ -0,0 +1,44 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_policy_state_move_may_throw.cpp, and compiled as a test. + +#include + +#include "preamble.hpp" + +// tag::content[] +#include + +struct cache_policy { + using category = cache_policy; + + template + struct fn { + struct state { + state() = default; + state(const state&) = default; + auto operator=(const state&) -> state& = default; + + auto operator=(state&&) noexcept -> state& { + return *this; + } + }; + + template + static void initialize(const Context&, const std::tuple&) { + } + }; +}; + +struct cached_registry : default_registry::with {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, cached_registry); + +void init() { + initialize(); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_policy_state_not_copyable.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_policy_state_not_copyable.cpp new file mode 100644 index 00000000..6d7dae3b --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_policy_state_not_copyable.cpp @@ -0,0 +1,39 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_policy_state_not_copyable.cpp, and compiled as a test. + +#include + +#include "preamble.hpp" + +// tag::content[] +#include +#include + +struct cache_policy { + using category = cache_policy; + + template + struct fn { + struct state { + std::shared_ptr data; + }; + + template + static void initialize(const Context&, const std::tuple&) { + } + }; +}; + +struct cached_registry : default_registry::with {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, cached_registry); + +void init() { + initialize(); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_register_classes_group_order.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_register_classes_group_order.cpp new file mode 100644 index 00000000..b7767808 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_register_classes_group_order.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_register_classes_group_order.cpp, and compiled as a test. + +#include "preamble.hpp" + +#if BOOST_OPENMETHOD_HAS_REFLECTION + +// tag::content[] +BOOST_OPENMETHOD_REGISTER(register_classes<{^^Node, ^^Plus}, {^^my_registry}>); +// end::content[] + +#endif diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_register_classes_incomplete.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_register_classes_incomplete.cpp new file mode 100644 index 00000000..5d36fb4b --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_register_classes_incomplete.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_register_classes_incomplete.cpp, and compiled as a test. + +#include "preamble.hpp" + +#if BOOST_OPENMETHOD_HAS_REFLECTION + +// tag::content[] +struct Minus : Node {}; + +BOOST_OPENMETHOD_REGISTER(register_classes<{^^Node, ^^Minus}>); +// end::content[] + +#endif diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_register_classes_mixed_group.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_register_classes_mixed_group.cpp new file mode 100644 index 00000000..2552dbab --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_register_classes_mixed_group.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_register_classes_mixed_group.cpp, and compiled as a test. + +#include "preamble.hpp" + +#if BOOST_OPENMETHOD_HAS_REFLECTION + +// tag::content[] +BOOST_OPENMETHOD_REGISTER(register_classes<{^^Node, ^^Plus}, {^^my_registry}>); +// end::content[] + +#endif diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_register_classes_not_a_class.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_register_classes_not_a_class.cpp new file mode 100644 index 00000000..e079c4ff --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_register_classes_not_a_class.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_register_classes_not_a_class.cpp, and compiled as a test. + +#include "preamble.hpp" + +#if BOOST_OPENMETHOD_HAS_REFLECTION + +// tag::content[] +BOOST_OPENMETHOD_REGISTER(register_classes<{^^Node, ^^Plus}>); +// end::content[] + +#endif diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_ambiguous_bases.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_ambiguous_bases.cpp new file mode 100644 index 00000000..d87ac581 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_ambiguous_bases.cpp @@ -0,0 +1,27 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_registry_ambiguous_bases.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + friend auto boost_openmethod_registry(Expr*) -> my_registry; +}; + +struct Term { + virtual ~Term() = default; + friend auto boost_openmethod_registry(Term*) -> default_registry; +}; + +struct Sum : Expr, Term { + friend auto boost_openmethod_registry(Sum*) -> my_registry; +}; + +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_affinities.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_affinities.cpp new file mode 100644 index 00000000..2658502e --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_affinities.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_registry_conflicting_affinities.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus); +BOOST_OPENMETHOD_CLASSES(Expr); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_carriers.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_carriers.cpp new file mode 100644 index 00000000..ef95ad8d --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_carriers.cpp @@ -0,0 +1,24 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_registry_conflicting_carriers.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +BOOST_OPENMETHOD( + print, (virtual_ptr, virtual_ptr, std::ostream&), + void); +// end::content[] + +void call(Plus& plus, Expr& expr) { + print(plus, expr, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_declared_late.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_declared_late.cpp new file mode 100644 index 00000000..27a7b436 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_declared_late.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_registry_declared_late.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + using boost_openmethod_registry = my_registry; + virtual ~Expr() = default; + virtual_ptr next; +}; + +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch.cpp new file mode 100644 index 00000000..eb296b60 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_registry_mismatch.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD( + postfix, (virtual_ptr, std::ostream&), void, + my_registry); +// end::content[] + +void call(Plus& plus) { + postfix(plus, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_classes.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_classes.cpp new file mode 100644 index 00000000..41098c47 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_classes.cpp @@ -0,0 +1,20 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_registry_mismatch_classes.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +struct Sum : Expr {}; + +BOOST_OPENMETHOD_CLASSES(Expr, Sum, my_registry); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_parameter.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_parameter.cpp new file mode 100644 index 00000000..58465f8b --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_parameter.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_registry_mismatch_parameter.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void, my_registry); +// end::content[] + +void call(Expr& expr) { + postfix(expr, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_not_a_registry.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_not_a_registry.cpp new file mode 100644 index 00000000..03ce4626 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_not_a_registry.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_registry_not_a_registry.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_rtti_not_polymorphic.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_rtti_not_polymorphic.cpp new file mode 100644 index 00000000..15a5bf09 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_rtti_not_polymorphic.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_rtti_not_polymorphic.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Literal { + virtual ~Literal() = default; +}; + +void print(Literal& literal) { + default_registry::policy::dynamic_vptr(literal); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_rtti_without_dynamic_type.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_rtti_without_dynamic_type.cpp new file mode 100644 index 00000000..297ef70e --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_rtti_without_dynamic_type.cpp @@ -0,0 +1,38 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_rtti_without_dynamic_type.cpp, +// and compiled as a test. + +#include +#include + +#include "preamble.hpp" + +// tag::content[] +struct my_rtti : policies::rtti { + template + struct fn : defaults { + template + static constexpr bool is_polymorphic = std::is_polymorphic_v; + + template + static auto static_type() -> type_id { + return &typeid(T); + } + + template + static auto dynamic_type(const T& obj) -> type_id { + return &typeid(obj); + } + }; +}; + +struct rtti_registry : default_registry::with {}; + +void print(Node& node) { + virtual_ptr p(node); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_shared_ptr_by_reference.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_shared_ptr_by_reference.cpp new file mode 100644 index 00000000..95037746 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_shared_ptr_by_reference.cpp @@ -0,0 +1,15 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_shared_ptr_by_reference.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (shared_virtual_ptr, std::ostream&), void); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_shared_ptr_overrider.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_shared_ptr_overrider.cpp new file mode 100644 index 00000000..3785fdb8 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_shared_ptr_overrider.cpp @@ -0,0 +1,21 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_shared_ptr_overrider.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD( + postfix, (virtual_&>, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (const std::shared_ptr&, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_virtual_by_value.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_virtual_by_value.cpp new file mode 100644 index 00000000..4c6d5e51 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_virtual_by_value.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_virtual_by_value.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); +// end::content[] + +void call(Plus& plus) { + postfix(plus, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_virtual_non_polymorphic.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_virtual_non_polymorphic.cpp new file mode 100644 index 00000000..3d89a407 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_virtual_non_polymorphic.cpp @@ -0,0 +1,21 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_virtual_non_polymorphic.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Literal { + virtual ~Literal() = default; +}; + +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); +// end::content[] + +void call(Literal& literal) { + postfix(literal, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_virtual_ptr_by_reference.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_virtual_ptr_by_reference.cpp new file mode 100644 index 00000000..143e1746 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_virtual_ptr_by_reference.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_virtual_ptr_by_reference.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); +// end::content[] + +void call(Plus& plus) { + virtual_ptr node(plus); + postfix(node, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_virtual_ptr_of_raw_pointer.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_virtual_ptr_of_raw_pointer.cpp new file mode 100644 index 00000000..23c67cb7 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_virtual_ptr_of_raw_pointer.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_virtual_ptr_of_raw_pointer.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +void print(Node* node) { + postfix(node, std::cout); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_weak_ptr_in_virtual_ptr.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_weak_ptr_in_virtual_ptr.cpp new file mode 100644 index 00000000..f892d917 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_weak_ptr_in_virtual_ptr.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_weak_ptr_in_virtual_ptr.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +void watch(std::weak_ptr node) { + weak_virtual_ptr p(node); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_wrap_inplace_vptr.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_wrap_inplace_vptr.cpp new file mode 100644 index 00000000..ef6225a3 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_wrap_inplace_vptr.cpp @@ -0,0 +1,23 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for compile_fail_wrap_inplace_vptr.cpp, +// and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +struct Term : inplace_vptr_base { + virtual ~Term() = default; +}; + +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); + +void print(Term& term) { + postfix(term, std::cout); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_wrap_virtual_any.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_wrap_virtual_any.cpp new file mode 100644 index 00000000..4a38ac56 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_wrap_virtual_any.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the fix for +// compile_fail_wrap_virtual_any.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (virtual_std_any&, std::ostream&), void); + +void print(virtual_std_any& node) { + postfix(node, std::cout); +} +// end::content[] diff --git a/doc/modules/ROOT/nav.adoc b/doc/modules/ROOT/nav.adoc index 7806b794..2b470949 100644 --- a/doc/modules/ROOT/nav.adoc +++ b/doc/modules/ROOT/nav.adoc @@ -16,9 +16,9 @@ ** xref:interop_any.adoc[Interoperation with `any`] ** xref:interop_type_erasure.adoc[Interoperation with Boost.TypeErasure] ** xref:shared_libraries.adoc[Shared Libraries] -* xref:troubleshooting.adoc[Troubleshooting] * Reference ** xref:ref_headers.adoc[Headers] ** xref:ref_macros.adoc[Macros] ** xref:reference:boost/openmethod.adoc[Namespace boost::openmethod] +* xref:troubleshooting.adoc[Troubleshooting] * xref:acknowledgements.adoc[Acknowledgements] diff --git a/doc/modules/ROOT/pages/troubleshooting.adoc b/doc/modules/ROOT/pages/troubleshooting.adoc index 0a0251b5..7ddbbd2d 100644 --- a/doc/modules/ROOT/pages/troubleshooting.adoc +++ b/doc/modules/ROOT/pages/troubleshooting.adoc @@ -1,9 +1,21 @@ :toc: macro -:toclevels: 2 +:toclevels: 3 :toc-title: Contents [#troubleshooting] +// The theme draws a rule in a very light grey; on this page, rules separate +// the entries, so they need to stand out. +++++ + +++++ + toc::[] OpenMethod catches most mistakes at compile time. The rest surface at run time: @@ -52,40 +64,82 @@ include::example$troubleshooting/preamble.hpp[tag=content] #### `method has no virtual parameters` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_no_virtual_parameters.cpp[tag=content] ---- A method dispatches on the parameters declared with `virtual_` or -`virtual_ptr`. Without one, it is an ordinary function. Here, the first -parameter is `virtual_` or `virtual_ptr`. +`virtual_ptr`. Without one, it is an ordinary function. + +Declare the parameters to dispatch on as virtual. Here, the first parameter is +`virtual_` or `virtual_ptr`. The method then selects an overrider +from the dynamic type of the node. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_no_virtual_parameters.cpp[tag=content] +---- + +''' #### `virtual_traits not specialized for type` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_virtual_by_value.cpp[tag=content] ---- A `virtual_` parameter is a reference, a pointer, or a smart pointer that -OpenMethod supports: `virtual_`, not `virtual_`. Dispatching on an -object passed by value would slice it. +OpenMethod supports. Dispatching on an object passed by value would slice it. + +Pass the object by reference: `virtual_`, not `virtual_`. The +method then sees the object itself, with its dynamic type. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_virtual_by_value.cpp[tag=content] +---- + +''' #### `virtual_<> parameter is not a polymorphic class...` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_virtual_non_polymorphic.cpp[tag=content] ---- The default registry finds the dynamic type of an object with `typeid`, which -yields it only for a polymorphic class. Give the root of the hierarchy a -virtual destructor. See also <>, the same mistake made -with `virtual_ptr`. +yields it only for a polymorphic class. See also <>, the +same mistake made with `virtual_ptr`. + +Give the root of the hierarchy a virtual destructor. It makes the class +polymorphic, and `typeid` then yields the dynamic type. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_virtual_non_polymorphic.cpp[tag=content] +---- + +''' #### `virtual_ptr<> must be passed by value or by const reference` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_virtual_ptr_by_reference.cpp[tag=content] @@ -95,23 +149,49 @@ A method takes a `virtual_ptr` by value - it is a pair of pointers, cheap to copy - or by const reference. It cannot take it by non-const reference, or by rvalue reference, because it may have to build one from its argument. +Take the `virtual_ptr` by value, or by const reference. The method can then +build it from any argument that converts to it, including a `virtual_ptr` to a +derived class, or a reference to the object. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_virtual_ptr_by_reference.cpp[tag=content] +---- + +''' + #### `virtual_ptr<> takes a class or a smart pointer: virtual_ptr, not virtual_ptr` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_virtual_ptr_of_raw_pointer.cpp[tag=content] ---- -A `virtual_ptr` is a pointer already. Its argument is the class, or a smart -pointer to it: `virtual_ptr`, `virtual_ptr>`. The -method declaration compiles, but the first use of `virtual_ptr` does -not. +A `virtual_ptr` is a pointer already. The method declaration compiles, but the +first use of `virtual_ptr` does not. + +Name the class: `virtual_ptr`. A `virtual_ptr` is built from a +`Node*`, so the call does not change. To dispatch through a smart pointer, name +the smart pointer instead: `virtual_ptr>`. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_virtual_ptr_of_raw_pointer.cpp[tag=content] +---- ### Overriders [#override_not_found] #### `BOOST_OPENMETHOD_OVERRIDE: cannot find '...' method that accepts the same arguments as the overrider` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_override_private_base.cpp[tag=content] @@ -122,8 +202,7 @@ not take the method as an argument: it finds the method by overload resolution, looking for a method of the same name that can be called with the overrider's arguments. Here `Minus` derives from `Node` _privately_ - `class` makes the inheritance private unless told otherwise - so a `virtual_ptr` does not -convert to a `virtual_ptr`, and `postfix` cannot be called with one. The -fix is `class Minus : public Node`. +convert to a `virtual_ptr`, and `postfix` cannot be called with one. The other causes of the same message are: @@ -161,9 +240,26 @@ The other causes of the same message are: When the overrider and the method differ only by their registry, the message says so instead: <>. +In the example, make the inheritance public: `class Minus : public Node`. A +`virtual_ptr` then converts to a `virtual_ptr`, and overload +resolution finds `postfix`. For the other causes, make the overrider callable +the same way: declare the method first, correct the name, or match the +parameters to the method's. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_override_private_base.cpp[tag=content] +---- + +''' + [#overrider_discards_const] #### `overrider parameter discards const qualifier` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_overrider_discards_const.cpp[tag=content] @@ -172,49 +268,103 @@ include::example$troubleshooting/compile_fail_overrider_discards_const.cpp[tag=c The method takes a `virtual_ptr`: it promises not to modify the node. The overrider for `Plus` takes a `virtual_ptr`, through which it could. When the method calls the overrider, it casts its argument to the type -of the overrider's parameter, and a cast cannot remove `const`. The fix is -`virtual_ptr`. +of the overrider's parameter, and a cast cannot remove `const`. Clang follows +the message with the error from the cast itself, which names the two classes: +`dynamic_cast from 'const Node' to 'Plus &' casts away qualifiers`. +Make the overrider's parameter `const` as well: `virtual_ptr`. The +cast then keeps the `const`, and the overrider keeps the promise of the method. The same applies to references and pointers: an overrider for -`virtual_` takes a `const Plus&`. Clang follows the message with -the error from the cast itself, which names the two classes: -`dynamic_cast from 'const Node' to 'Plus &' casts away qualifiers`. +`virtual_` takes a `const Plus&`. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_overrider_discards_const.cpp[tag=content] +---- + +''' #### `virtual_ptr<> is required in overrider in same position as in method` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_overrider_plain_reference.cpp[tag=content] ---- -Where the method takes a `virtual_ptr`, the overrider takes one too: -`virtual_ptr`. +The method takes a `virtual_ptr`, and the overrider a `Plus&` in the same +position. Where the method takes a `virtual_ptr`, the overrider takes one too. + +Take a `virtual_ptr` to the class of the overrider: `virtual_ptr`. The +method passes its argument on, cast to that class. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_overrider_plain_reference.cpp[tag=content] +---- + +''' #### `different virtual_ptr<> reference categories` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_overrider_reference_category.cpp[tag=content] ---- The method takes the `virtual_ptr` by value, and the overrider by const -reference. Use the same form in both. +reference. + +Use the same form in both: here, by value, as the method does. The overrider +then receives the `virtual_ptr` the way the method passes it. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_overrider_reference_category.cpp[tag=content] +---- + +''' [#overrider_pointer_kind] #### `different virtual_ptr<> pointer kinds` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_overrider_smart_virtual_ptr.cpp[tag=content] ---- -The method takes a plain `virtual_ptr`, and the overrider a smart one. Use the -same kind in both: `virtual_ptr` for `virtual_ptr`, -`shared_virtual_ptr` for `shared_virtual_ptr`. +The method takes a plain `virtual_ptr`, and the overrider a smart one. + +Use the same kind in both: `virtual_ptr` for `virtual_ptr`, +`shared_virtual_ptr` for `shared_virtual_ptr`. A plain pointer +cannot be turned into a smart one, so the overrider takes what the method +holds. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_overrider_smart_virtual_ptr.cpp[tag=content] +---- + +''' [#overrider_parameter_type] #### `non-virtual parameter types must match exactly` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_overrider_parameter_type.cpp[tag=content] @@ -224,8 +374,22 @@ The non-virtual parameters of an overrider have the same types as the method's. Here, `std::ostream&` would have to be cast to `std::ofstream&`, which cannot be done safely. +Declare the parameter with the type of the method: `std::ostream&`. The +overrider then receives the argument as the caller passed it. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_overrider_parameter_type.cpp[tag=content] +---- + +''' + #### `overrider return type is not convertible to method return type` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_overrider_returns_string.cpp[tag=content] @@ -233,21 +397,54 @@ include::example$troubleshooting/compile_fail_overrider_returns_string.cpp[tag=c An overrider returns the method's return type, or a type that converts to it, such as `Plus*` for `Node*`. If the method returns `void`, so does the -overrider. +overrider. Here, the method returns an `int`, and the overrider a +`std::string`, which does not convert to `int`. + +Return the type of the method, `int`, from the overrider. The method returns +what the overrider returns, so it must be able to convert it to its own return +type. If the overrider is right and the method is wrong, change the return type +of the method instead. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_overrider_returns_string.cpp[tag=content] +---- + +''' #### `virtual_<> is not allowed in overriders` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_core_overrider_virtual.cpp[tag=content] ---- -An overrider takes the plain type: `Plus&` where the method takes -`virtual_`. This message comes from the core API, as above. Through -`BOOST_OPENMETHOD_OVERRIDE`, the same mistake gives <>. +`virtual_` marks the parameters that a method dispatches on. An overrider does +not dispatch: it is called once the dispatch is done. This message comes from +the core API, as above. Through `BOOST_OPENMETHOD_OVERRIDE`, the same mistake +gives <>. + +Take the plain type in the overrider: `Plus&` where the method takes +`virtual_`. The method casts its argument to that type when it calls the +overrider. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_core_overrider_virtual.cpp[tag=content] +---- + +''' #### `method parameter must be an unambiguous accessible base of corresponding overrider parameter` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_core_overrider_private_base.cpp[tag=content] @@ -256,17 +453,29 @@ include::example$troubleshooting/compile_fail_core_overrider_private_base.cpp[ta The same mistake as in <>, made with the core API, which is given the method instead of looking for it. +Make the inheritance public, as there: `class Minus : public Node`. The method +can then cast a `virtual_ptr` to a `virtual_ptr`. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_core_overrider_private_base.cpp[tag=content] +---- + ### Classes and virtual pointers [#call_non_polymorphic] #### `no matching function for call to '_method_'` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_call_non_polymorphic.cpp[tag=content] ---- -[cols="1,3"] +[%autowidth,cols="1,3"] |=== | Compiler | Diagnostic @@ -289,11 +498,22 @@ no `static_assert` here, because the mistake is not in a declaration that the library sees: it is the absence of a conversion. For the same reason, `virtual_ptr p(plus)` reports that no constructor matches. -The usual fix is to make the root of the hierarchy polymorphic by giving it a -virtual destructor - which it needs anyway, if objects are ever deleted through -a pointer to it. Alternatively, cpp:inplace_vptr_base[] gives a class a v-table -pointer of its own, and a custom RTTI policy can find the dynamic type of -non-polymorphic classes: see xref:custom_rtti.adoc[Custom RTTI]. +Make the root of the hierarchy polymorphic by giving it a virtual destructor - +which it needs anyway, if objects are ever deleted through a pointer to it. +`typeid` then yields the dynamic type of a `Node`, and the object converts to a +`virtual_ptr`. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_call_non_polymorphic.cpp[tag=content] +---- + +Where the classes must stay non-polymorphic, there are alternatives. +cpp:inplace_vptr_base[] gives a class a v-table pointer of its own, and a +custom RTTI policy can find the dynamic type of non-polymorphic classes: see +xref:custom_rtti.adoc[Custom RTTI]. Where the caller knows the exact class of the object, cpp:final_virtual_ptr[] makes a `virtual_ptr` without looking for the dynamic type. It takes the static @@ -311,82 +531,184 @@ class, OpenMethod has no way to find out, even with runtime checks enabled. Passed a `Node&` that refers to a `Plus`, `final_virtual_ptr` makes a `virtual_ptr` to a `Node`, and the call dispatches on `Node`. +''' + #### `class must be an accessible unambiguous base, repeated inheritance is not supported` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_diamond_inheritance.cpp[tag=content] ---- `Both` inherits `Node` twice, through `Left` and through `Right`, so a pointer -to a `Both` cannot be converted to a pointer to a `Node`. Derive `Left` and -`Right` from `Node` virtually. A private base gives the same message. +to a `Both` cannot be converted to a pointer to a `Node`. A private base gives +the same message. + +Derive `Left` and `Right` from `Node` virtually. A `Both` then contains a +single `Node`, and the conversion is unambiguous. If the base is private +instead, make it public. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_diamond_inheritance.cpp[tag=content] +---- + +''' #### `use_classes: a class is incomplete` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_classes_forward_declared.cpp[tag=content] ---- -A class is registered where it is only declared. Register it after its -definition. +A class is registered where it is only declared. + +Register it after its definition. The library needs the complete class to find +its bases among the other classes of the list. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_classes_forward_declared.cpp[tag=content] +---- + +''' #### `a registry must be the last element of the list` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_classes_registry_first.cpp[tag=content] ---- -A class list names its registry last: -`BOOST_OPENMETHOD_CLASSES(Node, Plus, my_registry)`. +The registry is listed before the classes. A class list may end with a +registry, and only its last element is taken as one. + +Move the registry to the end of the list. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_classes_registry_first.cpp[tag=content] +---- + +''' #### `do not wrap an object that has a boost_openmethod_vptr overload in a virtual_ptr...` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_wrap_inplace_vptr.cpp[tag=content] ---- The object carries its own v-table pointer, here because it derives from -cpp:inplace_vptr_base[]. Pass the object itself to methods, which read the -v-table pointer from it. +cpp:inplace_vptr_base[]. It and a `virtual_ptr` serve the same purpose, fast +access to the v-table pointer, so wrapping one in the other is rejected. + +Pass the object itself to methods: declare the parameter as `virtual_`, +and the method reads the v-table pointer from the object. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_wrap_inplace_vptr.cpp[tag=content] +---- + +''' #### `class must inherit from inplace_vptr_base` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_inplace_vptr_derived_not_base.cpp[tag=content] ---- The bases passed to cpp:inplace_vptr_derived[] are themselves `inplace_vptr` -classes: here, `Node` would have to derive from `inplace_vptr_base`. +classes, but `Node` is not. + +Derive the root of the hierarchy from `inplace_vptr_base`: here, `Node` derives +from `inplace_vptr_base`. The root holds the v-table pointer, and +`inplace_vptr_derived` sets it to the v-table of `Minus`. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_inplace_vptr_derived_not_base.cpp[tag=content] +---- + +''' #### `registry can be specified only for root classes` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_inplace_vptr_derived_registry.cpp[tag=content] ---- -Only the root of an `inplace_vptr` hierarchy names the registry, as in +`Sum` names a registry, but it is not the root of its `inplace_vptr` +hierarchy. + +Name the registry at the root instead, as in `inplace_vptr_base`. Its derived classes inherit it. +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_inplace_vptr_derived_registry.cpp[tag=content] +---- + +''' + #### `the rtti policy deems this class polymorphic, so it must provide dynamic_type` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_rtti_without_dynamic_type.cpp[tag=content] ---- A custom cpp:rtti[] policy that reports a class as polymorphic must also be -able to find the dynamic type of its objects. Give it a `dynamic_type` -function, or make `is_polymorphic` false for that class. See +able to find the dynamic type of its objects. See xref:custom_rtti.adoc[Custom RTTI]. +Give the policy a `dynamic_type` function that returns the `type_id` of the +dynamic type of its argument, or make `is_polymorphic` false for that class. +Here, `dynamic_type` uses `typeid`, which matches `is_polymorphic`. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_rtti_without_dynamic_type.cpp[tag=content] +---- + +''' + #### `the rtti policy does not deem this class polymorphic` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_rtti_not_polymorphic.cpp[tag=content] @@ -396,14 +718,29 @@ The converse. The library never asks for the dynamic type of a class that its rtti policy does not deem polymorphic, so this message only comes from code that calls the vptr policy directly, or from a custom `virtual_traits`. +Ask for the dynamic type only of a class that the rtti policy deems +polymorphic. With the default registry, that is a class with a virtual +function: here, give `Literal` a virtual destructor. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_rtti_not_polymorphic.cpp[tag=content] +---- + ### Registries See xref:registries_and_policies.adoc#registry_affinity[Registry Affinity] for how a class, a parameter and a method come to belong to a registry. +''' + [#registry_mismatch] #### `registry mismatch` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_registry_mismatch.cpp[tag=content] @@ -411,11 +748,25 @@ include::example$troubleshooting/compile_fail_registry_mismatch.cpp[tag=content] A `virtual_ptr`, an overrider or a `virtual_any` belongs to a registry other than the method's. Here, `virtual_ptr` belongs to the default registry, -and the method to `my_registry`. Write `virtual_ptr`, or -declare an affinity for `my_registry` in `Node`. +and the method to `my_registry`. + +Put the parameter in the registry of the method: name the registry in the +`virtual_ptr`, as below, or declare an affinity for `my_registry` in `Node`, +which makes `virtual_ptr` belong to it. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_mismatch.cpp[tag=content] +---- + +''' #### `registry mismatch: the parameter belongs to another registry` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_registry_mismatch_parameter.cpp[tag=content] @@ -424,8 +775,22 @@ include::example$troubleshooting/compile_fail_registry_mismatch_parameter.cpp[ta The class of a virtual parameter declares an affinity for a registry, or the parameter names one, and the method names another. +Name the registry that the class declares on the method, or name none: a +method that names no registry takes the one its parameters carry. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_mismatch_parameter.cpp[tag=content] +---- + +''' + #### `registry mismatch: a class declares an affinity for another registry` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_registry_mismatch_classes.cpp[tag=content] @@ -434,40 +799,100 @@ include::example$troubleshooting/compile_fail_registry_mismatch_classes.cpp[tag= A class list names a registry, and one of the classes declares an affinity for another. +List the registry that the classes declare, or none: a list that names no +registry takes the one its classes agree on. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_mismatch_classes.cpp[tag=content] +---- + +''' + #### `virtual parameters carry conflicting registries` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_registry_conflicting_carriers.cpp[tag=content] ---- The method names no registry, and its virtual parameters belong to different -ones: `Node` to the default registry, `Expr` to `my_registry`. Name the -registry on the method, or make the parameters agree. +ones: `Node` to the default registry, `Expr` to `my_registry`. + +Make the parameters agree: `virtual_ptr`, as below, or +`virtual_`, which adopts the registry of the method because `Node` +declares none. Naming the registry on the method is not enough here: a +`virtual_ptr` always carries a registry, so `virtual_ptr` would then +give <>. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_conflicting_carriers.cpp[tag=content] +---- + +''' #### `the classes carry conflicting registry affinities - list the registry to say which one is meant` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_registry_conflicting_affinities.cpp[tag=content] ---- A class list mixes classes that declare different affinities, or, as here, -classes that declare one with classes that declare none. Add the registry at -the end of the list. +classes that declare one with classes that declare none. + +Here, `Node` and `Plus` belong to the default registry, and `Expr` to +`my_registry`. Register them in separate lists: each list then takes the +registry its classes agree on. When all the classes are meant for the same +registry, add it at the end of the list instead: +`BOOST_OPENMETHOD_CLASSES(Node, Plus, Expr, my_registry)`. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_conflicting_affinities.cpp[tag=content] +---- + +''' #### `cannot tell which registry this class belongs to...` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_registry_ambiguous_bases.cpp[tag=content] ---- The class inherits different affinities from several bases, or inherits one -from a private base. Declare its affinity in the class itself. +from a private base. + +Declare the affinity in the class itself. Its own declaration takes precedence +over the ones it inherits. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_ambiguous_bases.cpp[tag=content] +---- + +''' #### `boost_openmethod_registry must return a registry` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_registry_not_a_registry.cpp[tag=content] @@ -475,68 +900,150 @@ include::example$troubleshooting/compile_fail_registry_not_a_registry.cpp[tag=co The affinity declaration names a type that is not a registry. +Name a registry: a class derived from cpp:registry[], such as +`default_registry` or `my_registry`. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_not_a_registry.cpp[tag=content] +---- + +''' + #### `this class declared its registry affinity after it was first mentioned...` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_registry_declared_late.cpp[tag=content] ---- `virtual_ptr` was formed - here, inside `Expr` itself - before the -affinity declaration was seen, and kept the default registry. Move the -declaration up, to the top of the class, or name the registry where the class -is first used: `virtual_ptr`. +affinity declaration was seen, and kept the default registry. + +Move the declaration up, to the top of the class, so that it precedes every +use of the class. Alternatively, name the registry where the class is first +used: `virtual_ptr`. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_declared_late.cpp[tag=content] +---- ### Smart pointers #### `std::shared_ptr cannot be passed by non-const lvalue reference` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_shared_ptr_by_reference.cpp[tag=content] ---- +A method may have to build the smart pointer from its argument, for example a +`shared_virtual_ptr` from a `std::shared_ptr`. The result is a +temporary, which a non-const lvalue reference cannot bind to. + Pass a `std::shared_ptr`, or a `shared_virtual_ptr`, by value or by const reference. +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_shared_ptr_by_reference.cpp[tag=content] +---- + +''' + #### `cast only allowed to a shared_ptr` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_shared_ptr_overrider.cpp[tag=content] ---- The method takes a `std::shared_ptr`, and the overrider something else in the -same position: here, a non-const reference. It takes a `std::shared_ptr` too, -in the same form: `const std::shared_ptr&`. +same position: here, a non-const reference. + +The overrider takes a `std::shared_ptr` too, in the same form as the method: +`const std::shared_ptr&`. The method casts its argument to a new +`std::shared_ptr`, which a non-const reference cannot bind to. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_shared_ptr_overrider.cpp[tag=content] +---- + +''' #### `a std::weak_ptr cannot be wrapped in a virtual_ptr; use weak_virtual_ptr` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_weak_ptr_in_virtual_ptr.cpp[tag=content] ---- +A `virtual_ptr` refers to an object that exists, so that a method can dispatch +on it. A `std::weak_ptr` may outlive its object. + Use cpp:weak_virtual_ptr[] to keep a weak reference together with its v-table -pointer. +pointer. Its `lock()` returns a cpp:shared_virtual_ptr[], which can be passed +to a method. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_weak_ptr_in_virtual_ptr.cpp[tag=content] +---- + +''' #### `a weak pointer cannot be a virtual parameter; call lock() first` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_method_takes_weak_pointer.cpp[tag=content] ---- -A method cannot dispatch on an object that may no longer exist. Lock the -pointer, and pass the resulting shared pointer. +A method cannot dispatch on an object that may no longer exist. + +Make the parameter a `std::shared_ptr`. Lock the weak pointer before the call, +and pass the resulting shared pointer if the object still exists. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_method_takes_weak_pointer.cpp[tag=content] +---- ### `any` and type erasure See xref:interop_any.adoc[Interoperation with any] and xref:interop_type_erasure.adoc[Interoperation with Boost.TypeErasure]. +''' + #### `requires standard RTTI` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_any_custom_rtti.cpp[tag=content] @@ -545,50 +1052,123 @@ include::example$troubleshooting/compile_fail_any_custom_rtti.cpp[tag=content] Dispatching on the content of an `any` keys on its `std::type_info`, so the registry uses cpp:std_rtti[], or a policy derived from it. +Declare the method in a registry that uses `std_rtti`, here the default +registry. If the rest of the program needs cpp:static_rtti[], keep the methods +that dispatch on an `any` in a registry of their own: registries are +independent of each other. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_any_custom_rtti.cpp[tag=content] +---- + +''' + #### `virtual_any must be passed by reference` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_method_takes_virtual_any_by_value.cpp[tag=content] ---- A `virtual_any` passed by value would copy the `any`, and its content, on every -call. Write `virtual_std_any&` or `const virtual_std_any&`. +call. + +Pass it by reference: `const virtual_std_any&`, or `virtual_std_any&` if the +overriders modify the content. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_method_takes_virtual_any_by_value.cpp[tag=content] +---- + +''' #### `an owning type_erasure::any must be passed by reference` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_method_takes_erased_by_value.cpp[tag=content] ---- -The same, for a Boost.TypeErasure `any` that owns its value. The reference -forms, `any` and `any`, may be passed by value. +The same, for a Boost.TypeErasure `any` that owns its value. + +Pass it by reference, as a `std::any`: `virtual_`. The +reference forms, `any` and `any`, are handles that +do not own their value, and may be passed by value. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_method_takes_erased_by_value.cpp[tag=content] +---- + +''' #### `do not wrap a virtual_any in a virtual_ptr...` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_wrap_virtual_any.cpp[tag=content] ---- -A `virtual_any` already carries the v-table pointer of its content. Pass it by -reference instead. +A `virtual_any` already carries the v-table pointer of its content. + +Pass the `virtual_any` itself, by reference, to a method that takes a +`virtual_std_any&`. It plays the part that a `virtual_ptr` plays for a class. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_wrap_virtual_any.cpp[tag=content] +---- + +''' #### `use of deleted function ... final_virtual_ptr` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_final_virtual_ptr_any.cpp[tag=content] ---- cpp:final_virtual_ptr[] would use the v-table of the `any` class itself, not -that of its content, so the overloads for `any` types are deleted. Use a -`virtual_any` instead. Clang says `call to deleted function`, and MSVC +that of its content, so the overloads for `any` types are deleted. Clang says +`call to deleted function`, and MSVC `attempting to reference a deleted function`. +Hold the object in a cpp:virtual_std_any[] instead of a `std::any`, and pass it +by reference to a method that takes a `virtual_std_any&`. It acquires the +v-table pointer of its content once, when it is built - without a lookup, when +it is built from a value - and the method uses that pointer as it is. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_final_virtual_ptr_any.cpp[tag=content] +---- + +''' + #### `no matching function for call to ...cast` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_any_cast_mutable_reference.cpp[tag=content] @@ -596,15 +1176,29 @@ include::example$troubleshooting/compile_fail_any_cast_mutable_reference.cpp[tag The overrider takes the content of the `any` by a kind of reference that the `any` cannot provide: a mutable reference to the content of a const `any`, as -here, or an rvalue reference to the content of an lvalue `any`. Take -`const Plus&`. MSVC says `no matching overloaded function found`. +here, or an rvalue reference to the content of an lvalue `any`. MSVC says +`no matching overloaded function found`. + +Take the content by a reference that the `any` provides: here, `const Plus&`, +since the method takes a `const boost::any&`. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_any_cast_mutable_reference.cpp[tag=content] +---- ### Policies See xref:registries_and_policies.adoc[Registries and Policies]. +''' + #### `+the `state` of a policy that defines `initialize` must be copyable...+` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_policy_state_not_copyable.cpp[tag=content] @@ -612,61 +1206,132 @@ include::example$troubleshooting/compile_fail_policy_state_not_copyable.cpp[tag= `initialize` saves the `state` of each policy that has an `initialize` function, and restores it if another policy throws. A `std::unique_ptr` member -makes it impossible to copy: hold a `std::shared_ptr`, or a value. +makes it impossible to copy. + +Hold the data in a `std::shared_ptr`, or by value, so that the state can be +copied. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_policy_state_not_copyable.cpp[tag=content] +---- + +''' #### `+the `state` of a policy that defines `initialize` must be nothrow move-assignable...+` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_policy_state_move_may_throw.cpp[tag=content] ---- The state is restored from a destructor, while an exception is in flight, where -throwing would terminate the program. Declare the move assignment `noexcept`, -or let the compiler generate it. +throwing would terminate the program. + +Declare the move assignment `noexcept`, or let the compiler generate it: a +generated one is `noexcept` when those of the members are. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_policy_state_move_may_throw.cpp[tag=content] +---- + +''' #### `two or more stateful policies in this registry share the same nested state type...` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_policy_shared_state.cpp[tag=content] ---- The registry keeps the states of its policies together, and finds each by its -type. Give each policy a `state` type of its own, for example a nested struct. +type. + +Give each policy a `state` type of its own, for example a nested struct. Here, +each policy derives its `state` from `counter`, which keeps the members in one +place. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_policy_shared_state.cpp[tag=content] +---- + +''' #### `+the type_hash policy must appear before vptr_vector in the registry's policy_list+` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_policy_order.cpp[tag=content] ---- `vptr_vector` uses the hash computed by the `type_hash` policy, so it comes -after it in the registry's policy list. `with` replaces a policy in place, so -`default_registry::with` keeps the right order. -`without` followed by `with` appends the policy at the end. +after it in the registry's policy list. `without` followed by `with` appends +the policy at the end. + +Use `with` alone. It replaces a policy in place, so +`default_registry::with>` puts the new hash +where `fast_perfect_hash` was, ahead of `vptr_vector`. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_policy_order.cpp[tag=content] +---- + +''' #### `minimal_cover_hash needs BMI2...` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_minimal_cover_hash_without_bmi2.cpp[tag=content] ---- -cpp:minimal_cover_hash[] uses the x86-64 `PEXT` instruction. Compile every -translation unit with `-mbmi2`, or with a `-march` that implies it, or use -cpp:minimal_perfect_hash[], which is portable. MSVC does not report the error -for x64 builds: it compiles the instruction whatever the flags, so the program -requires a processor that supports it. +cpp:minimal_cover_hash[] uses the x86-64 `PEXT` instruction, and the +translation unit is compiled for a processor that may not have it. MSVC does +not report the error for x64 builds: it compiles the instruction whatever the +flags, so the program requires a processor that supports it. + +Compile every translation unit with `-mbmi2`, or with a `-march` that implies +it, such as `-march=haswell`. If the program must also run on processors +without BMI2, or on other architectures, use cpp:minimal_perfect_hash[] +instead, which is portable. + +*Fix* + +[source,cmake] +---- +target_compile_options(my_app PRIVATE -mbmi2) +---- ### C++26 reflection The examples need a compiler that supports reflection, such as GCC 16 with `-std=c++26 -freflection`. +''' + #### `a group holds reflections of namespaces, classes or registries` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_register_classes_not_a_class.cpp[tag=content] @@ -675,27 +1340,68 @@ include::example$troubleshooting/compile_fail_register_classes_not_a_class.cpp[t A group passed to `register_classes` contains a reflection of something else, such as a fundamental type, an enumeration or a function. +List only namespaces, classes and registries: here, the classes `Node` and +`Plus`. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_register_classes_not_a_class.cpp[tag=content] +---- + +''' + #### `a group holds one kind of reflection...` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_register_classes_mixed_group.cpp[tag=content] ---- -Put the namespaces, the classes and the registries in groups of their own: -`register_classes<{^^Node, ^^Plus}, {^^my_registry}>`. +A group mixes reflections of different kinds: here, two classes and a +registry. + +Put the namespaces, the classes and the registries in groups of their own. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_register_classes_mixed_group.cpp[tag=content] +---- + +''' #### `order the groups as namespaces, classes, registries` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_register_classes_group_order.cpp[tag=content] ---- -The groups passed to `register_classes` are out of order. +The groups passed to `register_classes` are out of order: here, the registry +comes before the classes. + +Pass the namespaces first, then the classes, then the registries. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_register_classes_group_order.cpp[tag=content] +---- + +''' #### `a listed class must be complete` +*Example* + [source,c++] ---- include::example$troubleshooting/compile_fail_register_classes_incomplete.cpp[tag=content] @@ -703,20 +1409,45 @@ include::example$troubleshooting/compile_fail_register_classes_incomplete.cpp[ta A class listed explicitly is only declared, not defined. +Register the class after its definition. + +*Fix* + +[source,c++] +---- +include::example$troubleshooting/fix_register_classes_incomplete.cpp[tag=content] +---- + ### Platform These two do not depend on the program, so they come without an example. +''' + #### `This implementation requires that size_t and void* have the same size.` The platform is not supported. No x86, x86-64, ARM or AArch64 target is affected. +There is no fix in the program. OpenMethod reads type ids as unsigned +integers, so it needs one as wide as a pointer: `std::uintptr_t`, or +`std::size_t` where the standard library does not provide `std::uintptr_t`. A +target that has neither cannot use the library. + +''' + #### `+named_static_rtti requires __PRETTY_FUNCTION__ or __FUNCSIG__+` cpp:named_static_rtti[] derives class names from the predefined function name of GCC, Clang or MSVC, and the compiler provides neither. +Use cpp:static_rtti[] instead, if the program is a single module. The names +are what lets `named_static_rtti` merge the copies of a class that come from +different modules; `static_rtti` identifies classes without them, but its type +ids differ from one module to the next. A program that shares classes across +shared libraries needs cpp:std_rtti[], or a custom RTTI policy: see +xref:custom_rtti.adoc[Custom RTTI]. + ## Runtime errors Errors detected at run time are passed to the registry's @@ -747,6 +1478,8 @@ xref:reference:BOOST_OPENMETHOD_CLASSES.adoc[BOOST_OPENMETHOD_CLASSES]. So must the class of every object passed as a virtual argument. cpp:initialize[] detects the first two omissions: +*Example* + [source,c++] ---- include::example$snippets/errors_missing_class_method.cpp[tag=classes] @@ -754,6 +1487,8 @@ include::example$snippets/errors_missing_class_method.cpp[tag=classes] include::example$snippets/errors_missing_class_method.cpp[tag=init,indent=0] ---- +*Example* + [source,c++] ---- include::example$snippets/errors_missing_class_overrider.cpp[tag=classes] @@ -765,6 +1500,8 @@ The third one can be detected only during the call, and only if runtime checks are enabled. Otherwise, the call reads a v-table pointer that was never set up, and the behavior is undefined: it may call the wrong overrider, or crash. +*Example* + [source,c++] ---- include::example$snippets/errors_missing_class_call.cpp[tag=classes] @@ -772,6 +1509,22 @@ include::example$snippets/errors_missing_class_call.cpp[tag=classes] include::example$snippets/errors_missing_class_call.cpp[tag=use,indent=0] ---- +Register every class, in a `BOOST_OPENMETHOD_CLASSES` that also lists its +direct bases. `initialize` then knows the class and its place in the +hierarchy, and sets up its v-table. Listing `Animal`, `Dog` and `Bulldog` +together fixes all three examples. + +*Fix* + +[source,c++] +---- +include::example$snippets/fix_missing_class.cpp[tag=classes] + +include::example$snippets/fix_missing_class.cpp[tag=use,indent=0] +---- + +''' + #### `missing base _B_ -<| _D_` Error type: cpp:missing_base[]. @@ -782,6 +1535,8 @@ that are registered separately are unrelated, as far as OpenMethod is concerned. If an overrider implies that one derives from the other, `initialize` reports it: +*Example* + [source,c++] ---- include::example$snippets/errors_missing_base.cpp[tag=classes] @@ -789,8 +1544,13 @@ include::example$snippets/errors_missing_base.cpp[tag=classes] include::example$snippets/errors_missing_base.cpp[tag=init,indent=0] ---- -The message names the base class first, then the derived class. The fix is to -register the classes together: +The message names the base class first, then the derived class. + +Register the two classes in the same `BOOST_OPENMETHOD_CLASSES`. A class list +tells `initialize` which of its classes derive from which, so it learns that +`Dog` derives from `Animal`. + +*Fix* [source,c++] ---- @@ -805,6 +1565,8 @@ Error type: cpp:no_overrider[]. No overrider is applicable to the dynamic types of the virtual arguments: +*Example* + [source,c++] ---- include::example$snippets/errors_not_implemented.cpp[tag=classes] @@ -813,9 +1575,23 @@ include::example$snippets/errors_not_implemented.cpp[tag=use,indent=0] ---- This is not a mistake by itself: a method may well be meant for some classes -only. Either add an overrider for `Cat`, or one for `Animal` that serves as a -default. See <> to find out, at -`initialize` time, whether any call can end like this. +only. See <> to find out, at `initialize` time, +whether any call can end like this. + +Add an overrider for `Cat`, or one for `Animal`. An overrider for `Animal` +serves as a default: it is called for every class that has no more specialized +overrider of its own. + +*Fix* + +[source,c++] +---- +include::example$snippets/fix_not_implemented.cpp[tag=classes] + +include::example$snippets/fix_not_implemented.cpp[tag=use,indent=0] +---- + +''' #### `ambiguous` @@ -824,6 +1600,8 @@ Error type: cpp:ambiguous_call[]. Several overriders are applicable, and none of them is more specialized than all the others: +*Example* + [source,c++] ---- include::example$snippets/errors_ambiguous.cpp[tag=classes] @@ -832,8 +1610,21 @@ include::example$snippets/errors_ambiguous.cpp[tag=use,indent=0] ---- Both overriders accept two `Dog`{empty}s, and each is more specialized than -the other in one argument. Add an overrider for `(Dog, Dog)`. See -xref:multiple_dispatch.adoc[Multiple Dispatch]. +the other in one argument. See xref:multiple_dispatch.adoc[Multiple Dispatch]. + +Add an overrider for `(Dog, Dog)`. It is more specialized than both of the +others, so it is the one called for two `Dog`{empty}s. + +*Fix* + +[source,c++] +---- +include::example$snippets/fix_ambiguous.cpp[tag=classes] + +include::example$snippets/fix_ambiguous.cpp[tag=use,indent=0] +---- + +''' [#finding_undispatchable_calls] #### Finding the calls that cannot be dispatched @@ -861,6 +1652,8 @@ Error type: cpp:not_initialized[]. A method was called before cpp:initialize[]: +*Example* + [source,c++] ---- include::example$snippets/errors_not_initialized.cpp[tag=classes] @@ -869,10 +1662,23 @@ include::example$snippets/errors_not_initialized.cpp[tag=use,indent=0] ---- This is detected only with runtime checks; otherwise, the behavior is -undefined. Call `initialize` before the first method call, typically at the -start of `main`. A shared library loaded at run time adds classes, methods and -overriders, so call it again after loading one. See -xref:shared_libraries.adoc[Shared Libraries]. +undefined. + +Call `initialize` before the first method call, typically at the start of +`main`: it builds the dispatch tables that the call reads. A shared library +loaded at run time adds classes, methods and overriders, so call it again after +loading one. See xref:shared_libraries.adoc[Shared Libraries]. + +*Fix* + +[source,c++] +---- +include::example$snippets/fix_not_initialized.cpp[tag=classes] + +include::example$snippets/fix_not_initialized.cpp[tag=use,indent=0] +---- + +''' #### `invalid call to final construct: static type = _S_, dynamic type = _D_` @@ -881,6 +1687,8 @@ Error type: cpp:final_error[]. cpp:final_virtual_ptr[] takes the static type of its argument for its dynamic type, without checking it, unless runtime checks are enabled: +*Example* + [source,c++] ---- include::example$snippets/errors_final.cpp[tag=use,indent=0] @@ -890,6 +1698,13 @@ Pass `final_virtual_ptr` an object whose static type is exactly its dynamic type - here, `snoopy` itself - or use cpp:virtual_ptr[], which finds the dynamic type. +*Fix* + +[source,c++] +---- +include::example$snippets/fix_final.cpp[tag=use,indent=0] +---- + ### Builds #### `conflicting definitions of _R_` @@ -901,13 +1716,25 @@ Error type: cpp:odr_violation[]. program, or in none. When it is defined in some and not in others, cpp:initialize[] reports it before anything else: +*Example* + [source,c++] ---- include::example$snippets/errors_odr_violation.cpp[tag=init,indent=0] ---- Define the symbol in the build system, for every translation unit, rather than -in source files. +in source files. In CMake, `add_compile_definitions` in the top-level +`CMakeLists.txt`, before any `add_subdirectory`, applies to every target of the +project. This one defines the symbol in debug builds only. + +*Fix* + +[source,cmake] +---- +add_compile_definitions( + $<$:BOOST_OPENMETHOD_ENABLE_RUNTIME_CHECKS>) +---- ### Hash tables @@ -936,6 +1763,8 @@ With the default limits, the first three are unlikely with ordinary type ids, and cannot be provoked by a small program. The last two policies take their limits as template arguments, so it takes a registry configured to fail: +*Example* + [source,c++] ---- include::example$snippets/errors_hash_search.cpp[tag=classes] @@ -943,6 +1772,8 @@ include::example$snippets/errors_hash_search.cpp[tag=classes] include::example$snippets/errors_hash_search.cpp[tag=init,indent=0] ---- +*Example* + [source,c++] ---- include::example$snippets/errors_too_many_bits.cpp[tag=classes] @@ -950,7 +1781,20 @@ include::example$snippets/errors_too_many_bits.cpp[tag=classes] include::example$snippets/errors_too_many_bits.cpp[tag=init,indent=0] ---- -Raise the limit, or use another `type_hash` policy. The type ids that a policy -fails on usually come from a custom RTTI policy. See +The type ids that a policy fails on usually come from a custom RTTI policy. + +Raise the limit: `MaxSeeds`, the third template argument of +cpp:minimal_perfect_hash[], or `MaxBits`, the only one of +cpp:minimal_cover_hash[]. Here, their defaults, 16 and 24, are enough. Or use +another `type_hash` policy: see xref:shared_libraries.adoc#type_ids_across_modules[Type ids across modules] for how the policies compare. + +*Fix* + +[source,c++] +---- +include::example$snippets/fix_hash_search.cpp[tag=classes] + +include::example$snippets/fix_hash_search.cpp[tag=init,indent=0] +---- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1eea9b9d..c02ea531 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -245,6 +245,19 @@ foreach(compile_fail_cpp ${compile_fail_cpp_files}) openmethod_compile_fail_test(${testname} ${compile_fail_cpp} "${fail_regex}") endforeach() +# The fixes the troubleshooting page shows for those errors. They only have to +# compile: a fix that does not would send the reader from one error to another. +file(GLOB troubleshooting_fix_cpp_files + "${CMAKE_CURRENT_SOURCE_DIR}/../doc/modules/ROOT/examples/troubleshooting/fix_*.cpp") + +foreach(fix_cpp ${troubleshooting_fix_cpp_files}) + get_filename_component(stem ${fix_cpp} NAME_WE) + set(test_target "boost_openmethod-troubleshooting_${stem}") + add_library(${test_target} OBJECT EXCLUDE_FROM_ALL ${fix_cpp}) + target_link_libraries(${test_target} PRIVATE Boost::openmethod) + add_dependencies(tests ${test_target}) +endforeach() + if (TARGET Boost::dll) add_subdirectory(dynamic_loading) endif() diff --git a/test/Jamfile b/test/Jamfile index 782dbd91..be633571 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -121,6 +121,12 @@ if ! [ os.environ COVERITY_SCAN_TOKEN ] } } +# The fixes the troubleshooting page shows for the errors above. +for local src in [ glob ../doc/modules/ROOT/examples/troubleshooting/fix_*.cpp ] +{ + compile $(src) ; +} + build-project dynamic_loading ; build-project implicit_shared_libraries ; From 407406158bea372261db500f6d1f938c0f003821 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leroy Date: Sun, 8 Nov 2026 09:54:58 -0500 Subject: [PATCH 4/6] doc: troubleshooting: link each example to Compiler Explorer Every *Example* label now links to the example on Compiler Explorer, in an execution pane that shows the compiler output and, for an error reported at run time, the program output - no assembly. dev/ce_troubleshooting.py generates the links and rewrites them in place; run it whenever an example changes. A compile-time example becomes the preamble followed by the example file, without the guards that stand in for a missing feature. A run-time example, a Boost.Test program, becomes a main() that runs its tagged region without the harness, so the default error handler prints the message. The library comes from the flattened headers of develop. --check compiles and runs every example through the Compiler Explorer API and matches the output against the expected message. The ODR example needs two translation units and has no link. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr --- dev/ce_troubleshooting.py | 349 ++++++++++++++++++++ doc/modules/ROOT/pages/troubleshooting.adoc | 120 +++---- 2 files changed, 409 insertions(+), 60 deletions(-) create mode 100644 dev/ce_troubleshooting.py diff --git a/dev/ce_troubleshooting.py b/dev/ce_troubleshooting.py new file mode 100644 index 00000000..9cfbc996 --- /dev/null +++ b/dev/ce_troubleshooting.py @@ -0,0 +1,349 @@ +#!/usr/bin/env python3 +# Copyright (c) 2017-2026 Jean-Louis Leroy +# Distributed under the Boost Software License, Version 1.0. +# See accompanying file LICENSE_1_0.txt +# or copy at http://www.boost.org/LICENSE_1_0.txt) + +"""Link every example of the troubleshooting page to Compiler Explorer. + +Each `*Example*` label of `doc/modules/ROOT/pages/troubleshooting.adoc` gets a +link that opens the example on Compiler Explorer, with the source and the +output of the compiler - and of the program, for an error reported at run time +- and no assembly. Run it from the root of the repository whenever an example +changes; it rewrites the links in place: + + dev/ce_troubleshooting.py + +The source behind each link is built from the files the page includes: + +* A compilation error is `troubleshooting/preamble.hpp` - which the page shows + once, above the examples - followed by the tagged region of the example. +* A run-time error is a Boost.Test program. The link turns it into a `main` + that runs the tagged region, without the harness: the default error handler + then prints the message, as it would in the reader's program. + +The library headers are the flattened ones published next to the documentation +(see `ce/README.md`), so the messages are those of `develop`, not of the Boost +release that Compiler Explorer offers. + +`--check` compiles and runs every example on Compiler Explorer instead, and +reports the ones that do not produce the expected message. +""" + +import argparse +import json +import re +import sys +import textwrap +import urllib.request +from pathlib import Path + +from ce_link import BOOST, COMPILER, clientstate_url + +PAGE = Path("doc/modules/ROOT/pages/troubleshooting.adoc") +EXAMPLES = Path("doc/modules/ROOT/examples") +SITE = "https://boostorg.github.io/openmethod/" +OPTIONS = "-std=c++17" +# C++26 reflection: the version of gcc that implements P2996. +REFLECTION_COMPILER = "g161" +REFLECTION_OPTIONS = "-std=c++26 -freflection" +# Examples that cannot run on Compiler Explorer: two translation units. +NO_LINK = {"errors_odr_violation.cpp"} + +LABEL = re.compile(r"^\*Example\*( - link:\S+\[Compiler Explorer\^\])?$") +INCLUDE = re.compile(r"^include::example\$([^\[]+)\[tag=(\w+)") +TAG_DIRECTIVE = re.compile(r"\s*// (tag|end)::\w+\[\]\s*$") +LIBRARY_INCLUDE = re.compile(r"^#include <(boost/openmethod[^>]*)>") +# The guards that let a compile-fail example produce its diagnostic where the +# feature it misuses is not available. +FEATURE_GUARD = re.compile(r"BOOST_OPENMETHOD_HAS_(REFLECTION|PEXT)") + + +def tagged_region(lines, tag): + begin, end = f"// tag::{tag}[]", f"// end::{tag}[]" + starts = [i for i, line in enumerate(lines) if line.strip() == begin] + ends = [i for i, line in enumerate(lines) if line.strip() == end] + region = lines[starts[0] + 1 : ends[0]] + + return [line for line in region if not TAG_DIRECTIVE.match(line)] + + +def from_site(line): + return LIBRARY_INCLUDE.sub(rf"#include <{SITE}\1>", line) + + +def program(lines): + """The lines of a source, without the comments outside its tagged regions.""" + source = [] + depth = 0 + + for line in lines: + if TAG_DIRECTIVE.match(line): + depth += 1 if line.strip().startswith("// tag::") else -1 + continue + + if line.startswith("#include") and line in source: + continue + + # Comments are kept in the regions the page shows, and only there. + if depth or not line.startswith("//"): + source.append(line) + + return source + + +def compile_time_source(path): + lines = [] + guarded = False + skipping = False + + # The whole file, not just the region the page shows: a method may have to + # be called before the compiler instantiates the check that fails. + for line in path.read_text().splitlines(): + if FEATURE_GUARD.search(line): + guarded = skipping = True + elif skipping: + skipping = line.strip() != "#else" + elif line == '#include "preamble.hpp"': + preamble = (EXAMPLES / "troubleshooting/preamble.hpp").read_text() + lines += tagged_region(preamble.splitlines(), "content") + else: + lines.append(line) + + if guarded: + lines.pop(len(lines) - 1 - lines[::-1].index("#endif")) + + source = "\n".join(from_site(line) for line in program(lines)) + + return re.sub(r"\n{3,}", "\n\n", source).strip() + "\n" + + +def run_time_source(path, tags): + lines = path.read_text().splitlines() + test_case = next( + i for i, line in enumerate(lines) if line.startswith("BOOST_AUTO_TEST_CASE") + ) + source = [ + from_site(line) + for line in program(lines[:test_case]) + if not ( + "BOOST_TEST_MODULE" in line + or "]+)>", fetch, source, flags=re.M) + + +def compile_on_ce(source, compiler, options): + request = { + "source": inline_site_includes(source), + "options": { + "userArguments": options, + "compilerOptions": {"executorRequest": True}, + "filters": {"execute": True}, + "libraries": [{"id": "boost", "version": BOOST}], + }, + "lang": "c++", + "allowStoreCodeDebug": False, + } + http = urllib.request.Request( + f"https://godbolt.org/api/compiler/{compiler}/compile", + data=json.dumps(request).encode(), + headers={"Content-Type": "application/json", "Accept": "application/json"}, + ) + + with urllib.request.urlopen(http, timeout=120) as response: + result = json.load(response) + + def text(key, within=result): + return "\n".join(line["text"] for line in within.get(key, [])) + + build = result.get("buildResult", {}) + + return "\n".join( + [text("stdout", build), text("stderr", build), text("stdout"), text("stderr")] + ) + + +def check(page_lines): + failures = 0 + + for _, path, tags in examples(page_lines): + if path.name in NO_LINK: + continue + + source = source_for(path, tags) + compiler, options = compiler_for(source, path) + output = compile_on_ce(source, compiler, options) + # The regex works on bytes in CMake, where `.` would not match a + # three-byte curly quote; here it works on characters. + expected = expected_message(path) + ok = re.search(expected, output) is not None + failures += not ok + print(f"{'ok ' if ok else 'FAIL'} {path.name}", flush=True) + + if not ok: + print(textwrap.indent(source, " | ")) + print(textwrap.indent(output[-3000:], " > ")) + + return failures + + +def main(): + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + parser.add_argument("--check", action="store_true") + parser.add_argument("--print", type=Path, help="print the source for an example") + args = parser.parse_args() + page_lines = PAGE.read_text().splitlines() + + if args.check: + sys.exit(1 if check(page_lines) else 0) + + for i, path, tags in examples(page_lines): + if args.print and path.name == args.print.name: + print(source_for(path, tags)) + return + + if path.name in NO_LINK: + page_lines[i] = "*Example*" + continue + + source = source_for(path, tags) + compiler, options = compiler_for(source, path) + url = clientstate_url(session_state(source, compiler, options)) + page_lines[i] = f"*Example* - link:{url}[Compiler Explorer^]" + + if not args.print: + PAGE.write_text("\n".join(page_lines) + "\n") + + +if __name__ == "__main__": + main() diff --git a/doc/modules/ROOT/pages/troubleshooting.adoc b/doc/modules/ROOT/pages/troubleshooting.adoc index 7ddbbd2d..f0846d0d 100644 --- a/doc/modules/ROOT/pages/troubleshooting.adoc +++ b/doc/modules/ROOT/pages/troubleshooting.adoc @@ -64,7 +64,7 @@ include::example$troubleshooting/preamble.hpp[tag=content] #### `method has no virtual parameters` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUlFr2zAQ%2FitCg%2BCQNFm6hzK1zUNpYC%2BrAyt7aUpQ5It9VJaEJWUtwfvtO7nO4q0O2Lnvu%2B87ne6O3IP3aI3ngj0dORb0XUwZ19KUUZZAIVeTCSfI29ioDviERulYALtB60MDsl5uzMac4SoE58V8vrPE26aclRiquJuhnVsHpoZQ2eKdHQCzyrnOKHo0JTOyBu%2BkAtYlCnHOvE5ZVDmqwB4sVTxuDKPngE2IUrPfCczG7JYVsJdRBxK0Q9FaR89Er%2F2Hqd%2B2DZRI0Rsl9PK%2FkBC%2FqJMbZzUqBC9EE03AGraqAvXilyezuzz%2F8bjN16uH76vHb%2Fl95qiDPb5OWZZqjqbMh4I6er%2B90XjKDhaLcadN%2F5iSWmfplCPm6D0%2Bddj7ZAnsTZSNISnbjUljUrZ2qKHpJvpMALyCijSFfsQnnqJ%2B3lylaV9%2BWXxOeo274TLw7vITcSBP2pSELb5e8jZ5Wxf65eEXdJhbWpXFFW8Hx%2FiJHnc6rc1eag8DJo%2FBxXDm6f4TLZsy1mBCZ8qHwEcrKonmlNcF%2F%2BW0z%2FT7AyJ%2F%2FYE%3D[Compiler Explorer^] [source,c++] ---- @@ -89,7 +89,7 @@ include::example$troubleshooting/fix_no_virtual_parameters.cpp[tag=content] #### `virtual_traits not specialized for type` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUsFO4zAQ%2FRXLK6FUdFvKHlaY0gMCiQsEaRGXLapcZ5qM1rGt2C6gKvvtjENKAyRSknlv5o0nb3bcg%2FdojeeC%2Fd1xLOg9GzOupSmjLIFCro6POUHexkZ1wA80SscC2BytDw3IerE0S3OAqxCcF9Pp2hJvm3JSYqjieoJ2ah2YGkJli3d2AEwq5zqh6NGUzMgavJMKWJcoxCHzPGVR56gCu7PUcbc0jK4tNiFKzf4nMBuxC1bARkYdqKAdFt3r6Jnoaz8x9euqgRIpeqWEvvwDEuKZJpk7q1EheCGaaALWsFIVqH9%2BsRe7zPM%2FD6v8%2Fvru9vrhJr%2FKHE2wwZcxy%2Fozruap%2BWLMfChotPffeDQas63FYtSJpC%2BmpNZZOu4Rc%2FQc7UftBbME9iLKxpAq26VJfilbO9TQdNY%2BEQAvoCLZ0Xu95ynqjecq2X76a3aS6jWuh1vBOxcSsSVNWpmEzc5OeZu0rQv9FvGfdJgL2pnZb94OjvGIHtc67c9Gag8DJo%2FBxXDgyYhEy6aMNZjQifIh8F2KWqLZ53XBl5z2ie43RO4BSg%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -113,7 +113,7 @@ include::example$troubleshooting/fix_virtual_by_value.cpp[tag=content] #### `virtual_<> parameter is not a polymorphic class...` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUlFv0zAQ%2FiuWkaZUKy0dD2im6wNiEg%2BwTGLihU6V61yTE45txXbZVIXfzjl11zDih%2Fi%2B7%2B7z2fcduAfv0RrPBft54FjRfzFlXEtTR1kDhVxdXnKCvI2dGoA3aJSOFbAlWh86kO1qbdbmDDchOC%2Fm860l3nb1rMbQxO0M7dw6MC2ExlZHdgTMGucGoejR1MzIFryTCtiQKMQ582PKopOjCuzO0omHtWH07bELUWr2J4HFhN2wCnYy6kAF%2FbjoXkfPRK79h2mfNx3USNEzJeTyF0iI33STpbMaFYIXoosmYAsb1YD65VevxL5igI76yeinsvz%2BsCnvb%2B%2B%2B3T58KT8Xju61w6cpK3Lnm2UuuVhNmQ8VXfr4wBeTKdtbrCaDUNoxJbUuTulMHzeT01Nk6SLjWU3ZGJJEvzZppMq2DjV0w%2FQfCYAnUJEmlu1w4inK3uAqOePq%2FeJdqte4HRuHD4NKxJ40yVUJW1xf8T5pWxey0fhbauaGbLX4wPtRGz%2FQ41Yni%2B2k9jBiyhhcDGeenjfRsqtjCyYMonwM%2FC9FR6I55Q3Bq5z%2BkdZfS2EOqw%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -138,7 +138,7 @@ include::example$troubleshooting/fix_virtual_non_polymorphic.cpp[tag=content] #### `virtual_ptr<> must be passed by value or by const reference` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUl1v0zAU%2FSuWkapUKy0dD4is6wNiEi8sk5h4oVPlOrfJFY5t%2BaNsqsJv59pNaRiJlMTnnPuVe47cg%2FdotOcl%2B3HkWNN7OWNcCd1E0QAduby64gR5E53MwBvUUsUa2AqNDw5Et97ojb7AbQjWl4vFzhBvXDNvMLRxN0ezMBZ0B6E19YkdAfPW2pwoetQN06IDb4UEloVleVHeJBVVjjKwe0MVjxvN6DqgC1Eo9juBxZTdshr2IqpAAf046EFFz8oh9h%2Bme9k6aJBOLyQYwv9CZfmLJllZo1Ai%2BLJ0UQfsYCtbkD%2F9%2BpzsU1V9e9xWD3f3X%2B8ev1SfC0sT7PF5xoqhx60NbpXqrycz5kNN451%2B5WQ6YweD9TQnSl9MCqWK1PKEWXpOX417ScV0mjtrbk6SoW6RiKGONDEkut%2FotFZpOosKXHbAEwHwDDLS1gZLnHk6Df7gMrnj%2Bv3yXYpXuBubh%2BdlJeJAOclZCVt%2BvOZ9ym1sGMzG31Izt2St5Qfej9r4jh53KtlsL5SHEVPFYGO48LSvRAvXxA50yEn5GPg%2FFZVEfdblwytN%2F0T3H5z%2BDsQ%3D[Compiler Explorer^] [source,c++] ---- @@ -164,7 +164,7 @@ include::example$troubleshooting/fix_virtual_ptr_by_reference.cpp[tag=content] #### `virtual_ptr<> takes a class or a smart pointer: virtual_ptr, not virtual_ptr` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUl1v2zAM%2FCuCBgzOmiZL91BMS%2FMwrMBeVhdYsZelCBSZsYnKkqCPrEXg%2FfZRrtN4rQ3Y5h15FH088AAhoDWBC%2Fb7wLGi92LKuJamTrIGCrk6O%2BMEBZu86oF3aJROFbAl2hA9yHa1NmtzgpsYXRDz%2BdYSb309qzE2aTtDO7cOTAuxsdUzOwJmjXO9UApoamZkC8FJBaxPFOKU%2BSVnUeekIrux1PGwNoyuPfqYpGZ%2FM1hM2BWrYCeTjlTQjYtudQpMDLX%2FMe3TxkONFD1RwlD%2BAgnxhyZZOqtRIQQhfDIRW9ioBtRDWB3Fvpblz7tNeXt98%2BP67nv5rXA0wQ4fp6wYzrhx0S9z%2Fw%2BrKQuxovGef%2BX7yZTtLVaTXih%2FMefRxKJPZoaek%2BO8g2qRwUFF2RRzabc22TRlW4cafO%2FvPQHwCCqRJ4PhR56iwX2usvcXnxYfc73G7Xg1eG9FJvakSXuTscXnC95lbevisEr8nA5zRYuzuOTd6Bi%2FMOBW5yXaSR1gxJQpuhRPPLmRaenr1IKJvSgfA2%2BlqCWaY14fvMrp7un%2BB4ITAwU%3D[Compiler Explorer^] [source,c++] ---- @@ -190,7 +190,7 @@ include::example$troubleshooting/fix_virtual_ptr_of_raw_pointer.cpp[tag=content] [#override_not_found] #### `BOOST_OPENMETHOD_OVERRIDE: cannot find '...' method that accepts the same arguments as the overrider` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNptUsFu2zAM%2FRVBA4YETZOlOwzz3ByGBtgOrYuu6GUuDEVWbGKyJJhS1iLIvn2UYy9eW%2Btg8D3ykaLenqNCBGuQJ%2BznnkNJ%2F%2BWMcS1MFUSlKOTy7IwThDa0sgPegZE6lIqlYNG3SjSr3OTmBNfeO0wWi40l3rbVvAJfh80c7MI6ZRrla1se2REwr53rhAKCqZgRjUInpGJdYpKcMr%2FELOocpGc3ljruc8Po20Hrg9DsTwQnU3bJSrUVQXsqOIyLbnVAlvS1%2FzHNc9GqCih6poS%2B%2FB%2BUJL%2FpJqmzGiQoTJI2GA%2BNKmSt5C9cDWJSC0R2DeZVm69Z9uO%2ByG7XN9fr%2B2%2FZ1cTR3bbwNGOTfvrC%2BTaNJasZQ1%2FSvY87fj%2BdsZ2FcvqmTpE9rO%2Fuvl%2BtJ8dVvC3bTfRSl1kcpIdFWmRpynJ%2BnvO4utxEA0jbONCq7bzySIB6UjLQ%2B%2FbmGXiKeidxGX108XH5IdZr2IxtxrtnjcSONMmDEVt%2BvuCHqG2d723Jz2naSzLh8hM%2FjMZ4AISNjobcCo1qxGTBu%2BBPPL1spEVbhUYZ34nyMfBailqCGfK64EXO4ZHOXxRZGoI%3D[Compiler Explorer^] [source,c++] ---- @@ -258,7 +258,7 @@ include::example$troubleshooting/fix_override_private_base.cpp[tag=content] [#overrider_discards_const] #### `overrider parameter discards const qualifier` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNptUk1v2zAM%2FSuCBgwJkiVLdximuTkMDbAdVhdd0ctcGIqs2MRkSdBH1iJIf%2Fsox168rtbB4Hvkk0i%2BA%2FXSezDaU0Z%2BHihU%2BF%2FNCVVc15HXEkMqZjOKkDfRiQ54A1qoWEmSgfHBSd6uC13oM9yEYD1bLrcGeePqRQ2hidsFmKWxUrcyNKY6sSNg0VjbCUUPuiaat9JbLiTpEhk7Z35OWXhzFIFcG7zxUGiC3x5ciFyR5wROpuSSVHLHowpYcBwX3ajoCetr%2F2Hap9LJGjB6woS%2B%2FC%2FE2G%2FsJLNGgQDpGXNRB2hlKRopfvn1IPYlz3%2FclfnN5vr75u5rfjWx2MEOHudk0r%2BxtMFlAgd%2F6mA9Jz5U2ONpnm%2Bnc7I3UE1fVSvz%2B83t7berzeTU9uviqceXssT4QXmYmfEky0hBZwVNUyp02rUwrQUlXWeLBwTkoxQRV9n7ZOAx6k1DRbLMxYfV%2B1SvYDt2FO02mIg9aqLdErb6dEGPSdvY0DuQvsPXXqLfVh%2FpcfSMe%2FCwVcl7O668HDF5DDaGM49LTDR3dWylDp0oHQP%2FS%2BGVoIe8LniRc3zA8wdH7xM2[Compiler Explorer^] [source,c++] ---- @@ -288,7 +288,7 @@ include::example$troubleshooting/fix_overrider_discards_const.cpp[tag=content] #### `virtual_ptr<> is required in overrider in same position as in method` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNptUk1v2zAM%2FSuCBhQJkiVLdximuTkMDbAdVhdd0UtdGIqs2MRkSdBH1iJIf%2Fso1268btbB4Hvkoyi%2BA%2FXSezDaU0buDxQq%2FK%2FmhCqu68hriSEVsxlFyJvoRAe8Ay1UrCTJwPjgJG%2FXhS70CW5CsJ4tl1uDvHH1oobQxO0CzNJYqVsZGlO9sCNg0VjbCUUPuiaat9JbLiTpEhk7ZX5JWdg5ikCuDHY8FJrgtwcXIlfkOYGTKbkgldzxqAIWHMdF1yp6wvrav5j2qXSyBoyeMKEvf4UY%2B42TZNYoECA9Yy7qAK0sRSPFL78exL7m%2Bc%2FbMr%2FeXP3Y3H7LLycWJ9jB45xM%2BjuWNrgs9V%2FPiQ8VTvfykmfTOdkbqKb%2F1Snzu83NzffLzUgwzXL2RoQYP%2BgMb2M8yTJS0FlB02sUOu1UmNaCkq5b%2FwMC8lGKiCvr%2FTDwGPXmoCJZ4%2Fzj6kOqV7AdO4d2m0rEHjXRVglbfT6nx6RtbOidRt%2FjbS%2FQV6tP9Di6xh142KrksR1XXo6YPAYbw4nHZSWauzq2UodOlI6Bf6WwJeghrwve5Bwf8PwBiSAKlQ%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -312,7 +312,7 @@ include::example$troubleshooting/fix_overrider_plain_reference.cpp[tag=content] #### `different virtual_ptr<> reference categories` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNptUk1v2zAM%2FSuCBhQJkiVLdximuTkMDbAdVhdd0ctcGIqs2MRkSdBH1iJIf%2Fsox168btbB4Hvkoyi%2BA%2FXSezDaU0Z%2BHChU%2BF%2FNCVVc15HXEkMqZjOKkDfRiQ54A1qoWEmSgfHBSd6uC13oM9yEYD1bLrcGeePqRQ2hidsFmKWxUrcyNKY6sSNg0VjbCUUPuiaat9JbLiTpEhk7Z35KWdg5ikBuDHY8FJrgtwcXIlfkJYGTKbkildzxqAIWHMdFtyp6wvrav5j2uXSyBoyeMaEv%2FwMx9gsnyaxRIEB6xlzUAVpZikaKn349iH3O8%2B%2F3ZX67ufm2uf%2BSX08sTrCDpzmZ9HcsbXBZ6r%2BeEx8qnO70khfTOdkbqKb%2F1Snzh83d3dfrzeQ08FlW4A4DGYunGdcXr9SJ8UOD4dGMJ1lGCjoraHqmQqdlC9NaUNJ1vnhEQD5JEXGXvVEGHqPeNVQkz1y%2BX71L9Qq2Y0vRboWJ2KMm%2Bi1hq4%2BX9Ji0jQ29BelbvO0VGm71gR5H13gAD1uVzLfjyssRk8dgYzjzuMVEc1fHVurQidIx8K8UtgQ95HXBq5zjI57fBmITXA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -337,7 +337,7 @@ include::example$troubleshooting/fix_overrider_reference_category.cpp[tag=conten [#overrider_pointer_kind] #### `different virtual_ptr<> pointer kinds` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUstu2zAQ%2FBWCBQobdq06PRRVFB%2BKGGgPjYI0yCUKBJqipUUpkuDDTWA4396lLMVK2lulg7Azu7PUcPbUCedAK0dTcr%2BnUOF3OSdUMlUHVgssKZ%2FNKEJOB8s74B0oLkMlSAbaeStYuypUoU5w471xaZJsNPLa1osafBM2C9CJNkK1wje6OrIjYNEY0wkFB6omirXCGcYF6RrT9NR5Hrtwc%2BCeXGncuC8UwWcH1gcmyXMEJ1NyQSqxZUF6HDiMh65lcCTtZ18x7VNpRQ1YPWFDP%2F4Cpelv%2FJPMaAkchEtTG5SHVpS8EfyXWw1i%2F2tFAsoLq03ifFW6hllRlcbbF4e%2B5vnP2zK%2FXl%2F9WN9%2Byy8nBue38Dgnk96D2J7F%2F1vNCYqge8ebej%2Bdk52Ganr%2BL50yv1vf3Hy%2FXE%2BOhp5k%2B0OM1aOJb9WJdsOC4VK0I1lGCjoraLyGQsUwcd0akMJ2uXtAQDwKHtCgPogDj1WfSspjJs8%2BLT%2FGeQmbcWRpZ2AkdqiJeY7Y8ssZPURtbXwfcfoBT3uBgV5%2BpofRMe7AwUbGcG%2BZdGLE5MGb4E88piTSzNahFcp3onQM%2FC2FK0ENfV3xpufwgO8fdqY4sA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -363,7 +363,7 @@ include::example$troubleshooting/fix_overrider_smart_virtual_ptr.cpp[tag=content [#overrider_parameter_type] #### `non-virtual parameter types must match exactly` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNptUl1P2zAU%2FSuWJ6FW7dqVPUwzoQ8TlbYHCALEC0GR67jJ1Rzbiu0Cqspv5zpNaNhoHqp7zr3H9%2BPsqJPOgdGOMvKwo1Dg%2F2JKqOK6DLyUGFIxmVCEnAmNaIEvoIUKhSQJGOcbyetlpjN9hCvvrWPz%2Bdogb5pyVoKvwnoGZm6s1LX0lSkO7ACYVda2QsGBLonmtXSWC0naRMaOmWcxC18OwpMrgy%2FuMk3wt4XGB67IawRHY3JOCrnhQXks2A%2BLrlVwhHW1H5j6JW9kCRi9YEJX%2Fg4x9oSTJNYoECAdY03QHmqZi0qKv27Zix1XsRks6Fea3t7l6fXq6nJ19zu9GFmcawPPUzLqOs%2Btb5LY1XJKnC9w5kP5yXhKtgaK8dlnOnl6v7q5%2BXOxGh3W8LlsnPldtmvrhBjXS%2FdLNI4kCcnoJKNxbZmOxxemtqBk0%2FrkEQH5LEXA23bG6XmMOhdRET10%2Bn3xLdYrWA8tRtuTRmKLmui%2FiC1%2BntJ91DbWd5akX7HdczTg4gfdD9q4BwdrFc244crJAZMGb4M%2F8njVSPOmDLXUvhWlQ%2BB%2FKXwSdJ%2FXBv%2Fk7B%2FxewMsExl8[Compiler Explorer^] [source,c++] ---- @@ -388,7 +388,7 @@ include::example$troubleshooting/fix_overrider_parameter_type.cpp[tag=content] #### `overrider return type is not convertible to method return type` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNptUstu2zAQ%2FBWCvdiwY9fpoSjr%2BFDEQHtoFKRBLlVg0NRGWpQiCT7cBobz7V0qcqymkQ7CzuzsQzt7HiAEtCZwwX7uOVb0XUwZ19LUSdZAIVeTCSco2ORVB7xDo3SqgC1D9GjqVWlKcwLREgyyfQU3Mbog5vOtJd76elZjbNJ2hnZuHZgWYmOrZ3YAzBrnukIpUCdmZAvBSQWsSxTilPk5Z1HnpCK7stRxXxpGzw59TFKzpwyOxuyCVfAgk44kOAxF1zoFJnrtP0z7uPFQI0WPlNDLXyAhftMmS2c1KoQghE8mYgsb1YD6FVbHYl%2BK4sftprheX31f334tLkc7qRNM2aifcOOiX%2Bbuq%2FGUoYnjN1Wb4m59c%2FPtcv2mPO%2BQ5SFWQjxfZ3z8ER5i8oaVfFLyvHtp8lmVbR1q8J0D7gmAP6ASHai3xJGnqPcHV9kd5x8W77Ne43ZoHt7dJRM7qknOytji0zk%2F5NrWxd5s%2FIxGvCBrLT7yw2CMOwy41dlmD1IHGDBFii7FE0%2BnybT0dWrBxK4oHwL%2Fl6KWaI55XfAq53BP719B7Q2a[Compiler Explorer^] [source,c++] ---- @@ -416,7 +416,7 @@ include::example$troubleshooting/fix_overrider_returns_string.cpp[tag=content] #### `virtual_<> is not allowed in overriders` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUl1P20AQ%2FCunq4SCSJOGPiBc44eKqO1DMYKoLw2ynPPGXnG%2BO91HCorS3949x2AX7AfrZmd2d3yz5w6cQ60cT9jvPceKvosp47JUdShroCMXZ2ecIKeDFR3wAZWQoQKWonbeQtlma7VWA9x4b1wyn2801bWtZzX6JmxmqOfagGrBN7o6VkfArDGmaxQcqpqpsgVnSgGsIybJwPwSWTQ5CM9uNE3crxWjZ4fWh1KyvxGcnLIrVsG2DNKT4DAW3crgWNJr%2F6u0z4WFGun0TIRe%2FgolyR9ykhotUSC4JLFBeWyhEA2IR5e9aWZo7y0%2BFRg3PrrqIVrtaCUdOFO201hNehNFGrc7yabM%2BYrMH3%2F0yWnWDYjM1%2FaG3Ayy6O29rFN9zfP7VZHfLm9%2BLlff8%2Bvibvntx%2F1qeTfpW5FgB9ZiBem4eRblMQNCtwYl2C4uDwTAE4hAV9zn56VOpz5MXMQonX9efIp6iZtx0nh3s7FAU2MMI7a4POeH2Fsb3yeTfyQzV5TDxQU%2FjNb4hQ43MmZyW0oHo0oevAl%2BqNN9xHJp69CC8l1TPgbet6KRqF543eEN5%2FBA7z9q1yLk[Compiler Explorer^] [source,c++] ---- @@ -443,7 +443,7 @@ include::example$troubleshooting/fix_core_overrider_virtual.cpp[tag=content] #### `method parameter must be an unambiguous accessible base of corresponding overrider parameter` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNp1Ul1v00AQ%2FCunQ0KJmiakPCCM6wdEBDy0qdqIF1xZznljrzjfne4jtIrCb2fPcRqnCPvB2pndmdvz7LgD51ArxxP2c8exou98wrgsVR3KGqjk4uKCE%2BR0sKID3qASMlTAUtTOWyjbLFe5OsGN98Yls9laE69tPa3RN2E9RT3TBlQLvtHVgR0A08aYTig4VDVTZQvOlAJY15gkp85PsYucg%2FDsVpPjLleMni1aH0rJ%2FkRwNGbXrIJNGaSngf1w6E4Gx5J%2B9oxpnwsLNVL1TA39%2BAuUJL9pk9RoiQLBJYkNymMLhWhA%2FHLZUUzI0jl2g%2Bp%2FNoY22uBTgXGXw749RIc%2BLJmeeiZsq7Ea9esVxts0amYT5nxFF3P4CW%2FHWWcRe18M2niGs8nuVK9HmXbj4y1qx9KU5fwy5%2FHeouTn5fJhVSzvFrc3i9W35ZfifvH1%2B8NqcT%2FqfUhpC9ZiBemZczYmiZgeoVuDEmwXtEcC4AlEoHD0yTvyVPUx5CKG8Or9%2FF2cl7geZpR3mYgE2cYAR2z%2B8Yrvo7Y2vs80v6Q1rynB8w98PzjGD3S4ljHNm1I6GDDL4E3wJ57%2BV6RLW4cWlO9E%2BRD4V4osUR37uuJVz%2F6R3r%2BdKTaW[Compiler Explorer^] [source,c++] ---- @@ -468,7 +468,7 @@ include::example$troubleshooting/fix_core_overrider_private_base.cpp[tag=content [#call_non_polymorphic] #### `no matching function for call to '_method_'` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUtFqwjAU%2FZWQwajY6XQPY9X5MBS2h1lx4ss6pNZYL6RJaBKRSf99N7XO6nxbCw055%2BTc25uzp5ppDVJoGpDPPYUVrh2fUB6L1MYpwy1Nmk2KkJY2T0rgBkTC7YqRPkhtchZng0hE4gRvjFE6aLeXEnmZp60UzMYuWyDbUjGRMbORqwNbA1obpQb%2Ft2mDAAMxh29WOUbCahApKZVBcJIGwRZyY2O%2BUCbvOSH%2Bjk0MGUusvy%2Fq0IRbTYIz5iUMP2aLcDIav49mr%2BHQU%2Bi%2Fhp1PvJpv3x0Z%2BEQbrFfN67bhk62EVeOqzyKcj6bTt%2BHIiwTB57qta%2BjSlkh9dCb7w2GpSb9PItqMKBYrXD0QhmQxCO9XdGUypyl6hy6drhyCwk%2FvrDPPQVUribSmcajkUpPITAFneRmwLwTYjiUWb7NK3JHHXRU%2FmrjwdR869%2B48h2U9m7Ts1BFb9MTgOqzz1KWF85bKVFmmd9jMMya380iLWhtz0LDkLsXrmGtWY0JrlDUnHm%2Fd0XGe2owJU5rSOvDXCkuCOOrKzYWm%2BML3B23jLOw%3D[Compiler Explorer^] [source,c++] ---- @@ -535,7 +535,7 @@ Passed a `Node&` that refers to a `Plus`, `final_virtual_ptr` makes a #### `class must be an accessible unambiguous base, repeated inheritance is not supported` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNptUslOwzAQ%2FRXLXECUlsIBYRaJpRIHIIgiLhRVrjNNRji2Fdssqsq3Mw6BhiU5RPM2J3mz4B68R2s8F%2BxhwTGn57DHuJamiLIAGrna3OQEeRtr1QBraJSOObBDtD7UIKvjiZmYFVyG4LwYDGaWeFsX%2FQJDGWd9tAPrwFQQSpt%2Fsh2gXzrXBEWPpmBGVuCdVMAaoRAr5UFS0clRBXZt6cTFxDC6nrEOUWr2nsD1DXbEcpjLqAMZll3TjY6eidb7g6nepjUUSNMbCVr7NyTEC33JobMaFYIXoo4mYAVTVYJ68se%2Fwi5hHn4c0%2BK3WJT%2FEqc2lIQnX69VtYmnWTa%2Bm2Y3o%2Bur0d1Fdj49uzwZj0fj9ZTR6zp6TcoGuVJrylYONdRNwY8EwCuoSKW0jX%2FxNLX1c5XK39kdbie%2Fxll3N3jTRSKeKZMWJ2HD%2FR2%2BTNnWhXaX%2BJYP%2BRFtznCPLzuvcY8eZzpt0VxqDx0mi8HFsOLphyRa1kWswIQmlHeBv1F0JJovXTP80iwf6f4A2e4Cgg%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -561,7 +561,7 @@ include::example$troubleshooting/fix_diamond_inheritance.cpp[tag=content] #### `use_classes: a class is incomplete` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUstO6zAQ%2FRXLdwOitBQWV5iHBNxKdwGkUhEbiirXGZIRjm3FNg9V5dsZm0ADJItozjnzPFlxD96jNZ4LdrfiWNJ3PGBcS1NFWQGFXO3scIK8ja3KwB80SscS2DFaH1qQzenczM0GrkNwXoxGS0u8bathhaGOyyHakXVgGgi1LT%2FYHjCsncuFokdTMSMb8E4qYFkoxEZ5lFTUOarAri11XM0No%2BcJ2xClZm8J3NpmJ6yEBxl1oIR1P2mqo2eiy%2F3GNK%2BLFiqk6JUEXfoXJMQzbXLsrEaF4IVoownYwELVoB796Y9iV0i7ZOC8KGY3i2I6ub6a3Pwv%2Fi0uLs9ms8lsK40wyPMMPuTbpE%2FnVrZxqKHNztwTAC%2BgIl2zs%2BqTp6jzjavk2v7BeC%2Fla1z2TeX5iIl4oprkeMLGh%2Ft8nWpbF7qfgO%2F6UJ6Q5eO%2FfN0b4xY9LnWy%2F0FqDz2miMHFsOFp9UTLtooNmJCL8j7wuxS1RPOpy8EPzfqe3nfkEuqM[Compiler Explorer^] [source,c++] ---- @@ -584,7 +584,7 @@ include::example$troubleshooting/fix_classes_forward_declared.cpp[tag=content] #### `a registry must be the last element of the list` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUcFuGjEQ%2FRXLvQSFQEkPVdyA1CZIPbTZSES5FISMd9gdxWtba5skQvTbO3aWsG3Xh9W8N%2B%2BNPW%2FPPXiP1ngu2K89x5L%2BkyHjWpoqygqo5Or8nBPkbWxVBj6gUTqWwK7R%2BtCCbGZLszQnuA7BeTEebyzxtq1GFYY6bkZox9aBaSDUtnxje8Codi4bRY%2BmYkY24J1UwHKjEKfOL6mLJkcV2J2lifulYfTtsA1RavY7gWcDNmUlbGXUgQSHvuheR89Ep%2F2LaV7XLVRI1Ss1dPJ3SIhnesm1sxoVgheijSZgA2tVg3rys6PZt6JYPKyL%2B%2Fndz%2FnD9%2BJ2ffPj62IxX5z17Id5%2FDDfZUCqtGNlG4ca2hzHigB4ARVphV0%2BR56qLiyuUlSXnyYfk17jpp8kz5tLxI48KeaETa4u%2BSF5Wxe65PmFD%2BWUcp585ofeNR7R40anzLdSe%2BgxRQwuhhNPy0u0bKvYgAnZlPeB%2F61oJJpjXy7%2B6Tms6PwBSOjmng%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -607,7 +607,7 @@ include::example$troubleshooting/fix_classes_registry_first.cpp[tag=content] #### `do not wrap an object that has a boost_openmethod_vptr overload in a virtual_ptr...` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUstu2zAQ%2FBWCAQoHae04OQRhHX9Cm0OQSx0IFLWRFqVIgly6DQz327NU5Fh53CoBEnZmdpZczE4mSAm9S1KJXzuJDf%2BXX4W02rVZt8ClNGdnkqHkczQDcILO2NyAWKFPFEH3643buCPcEYWkFovaM%2B9jO2%2BRulzP0S98ANcDdb55YSfAvAthMMoJXSuc7iEFbUAMQqWOyu9FxZOzIfHD88Tdxgl%2Bthgpayv%2BFXB2Km5EA486W%2BKG%2FbTp1uYk1Nj7humfqggtcvXEgrH9FVLqD99kFbxFg5CUitkR9lCZDszvtD6Y%2Fe8qFuiC5atX20DxdS%2FjEe8g9ny2qaSqdYJVIdYfdlHQT3ex9diIENHRrGi%2BCOLv6bv%2Bit1H4zAbBKV%2F40oijO8DWohDeB4YgL9gMt9yTNOB52qMljQlWBeXy%2FPSb7Ge5k4OWyjElj05lAVbXl%2FIffH2gcacym%2BJmhtO5fJK7ifHuMeEtS0JfdQ2wYT5mSlkOvK8x0Lr2OYeHA2mcgp8tOKR6A66oXin2T%2Fw%2BwxeBSgL[Compiler Explorer^] [source,c++] ---- @@ -632,7 +632,7 @@ include::example$troubleshooting/fix_wrap_inplace_vptr.cpp[tag=content] #### `class must inherit from inplace_vptr_base` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUstOAjEU%2FZWmbjQgCC6MFfkDHys3YkjpXGdu7LRNHygh%2BO3e1gFGXTpdTO45577as%2BUBQkBrAhfsecuxov9kyLiWpk6yBgq5Ggw4QcEmrwpwgkbpVAGboQ3Rg2znC7MwR7iJ0QUxHq8s8dbXoxpjk1YjtGPrwLQQG1t9sz1g1DhXCqWApmZGthCcVMCKUIij8iarqHNSkd1b6rhdGEbfGn1MUrPPDJ6esVtWwatMOlLCrp%2F0qFNgosv9wbSbpYcaKdqQoEs%2FQEK80yYzZzUqhCCETyZiC0vVgHoL832x%2F17FGI3TtPpy7aI%2F3Es34h2aw%2FRD1lcuK%2FC4hmpWJMOi6GbKL6hs61CDL4%2F9QgB8gEo0Vff6e56izgpcZSNMLycXOV%2Fjqu8TXqbOxJpqkokyNrme8l2ubV3sfMXPQ6xuyUWTK77rjfGEAVc6O%2BpV6gA95iFFl%2BKRp70zLX2dWjCxFOV94G8paolmryvBL83uhc4X%2Ft0MWA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -657,7 +657,7 @@ include::example$troubleshooting/fix_inplace_vptr_derived_not_base.cpp[tag=conte #### `registry can be specified only for root classes` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUstOwzAQ%2FBXLXECUlpYDwpR%2BAiCBuNCqcpxtssKxLT8KqCrfzjqkbShHkkO0M7OzXmc2PEAIaE3ggr1uOJb0HQ8Y19JUSVZAJVfn55ygYJNXLXCCRulUApuiDdGDbGZzMzcHuI7RBTEaFZZ466thhbFOxRDtyDowDcTalj9sDxjWzrVGKaCpmJENBCcVsFYoxEF5m1U0OanI7i1N3MwNo2eNPiap2VcGT8%2FYHSthJZOO1LDtNz3qFJjoen8xzefSQ4VUfZKga99DQrzTJlNnNSqEIIRPJmIDS1WDeguzndl%2Fr2KExmlafbl20e%2FvpTviM%2FiGztaXLAsZYJqJ2dE%2BTylrMzP43VGCxzWUUxIMOr63e2eT%2F7uyjUMNvo3IggD4AJVoly4zO56qLkBc5fhMrsaXuV9j0U8Xb3fNxJo8KXoZG99M%2BDZ7Wxe7NPKLEMs7yt74mm97x3jBgIXOOVxJHaDHPKToUjzwdAGZlr5KDZjYmvI%2B8NeKRqLZ6driSLNd0PsNIL0gqQ%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -681,7 +681,7 @@ include::example$troubleshooting/fix_inplace_vptr_derived_registry.cpp[tag=conte #### `the rtti policy deems this class polymorphic, so it must provide dynamic_type` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqNU21v2jAQ%2FiuWJ1WgtjC6D9NSyE%2FYpgnty6gi45jkNMe27DMrQtlv39kNJbB%2BaJBI%2FDz35rt7jjyoEMCawAv268ihpvfijnEtTBNFo%2BjI5e0tJyjY6GUGPoCROtaKLfHgVIVeAIZyYy5xMDtL4BgGG9Ar0V3BLaILxXy%2BtcRb38wawDZuZ2Dn1inTKWxt%2FcKOgFnrXA4UA5iGGdGp4IRULBsWxdnyMVlR5iiRfbWU8bgxjJ49eIxCs78JnEzZitVqJ6JGcujHTt91DKwYfC%2BY7lB51QCdDmQwuL9CRfGHbrJ0VoMEFYrCR4PQqUq2Sv4O5RvBEIECjTwSMNSLqnNaoFpKLUJgP4Ys5Qs7BNmZcyHh5PmG97o8UwEFgmSS9gDVs%2FOphZpBqKiOQ2e9a4ldkVldFJdotV%2Buy3yH96cREe3wXaVFoc7flyyvEtTjitPjFUZv2E3eqHqynj6e%2Bf7ls78eV%2BrZO8YytPt1CntL6Z0Hg5M06Rtm6H96tSyVQ79M9N1lmpK5SbZPxWxMEoy0nQOtfNbWEwHqWUm6ux%2FEduLpNCiPy6S7h0%2BLj8lfw3YsS573OhF7ikmaTdjiywPvU2zrcJAxv6c5rUi0i8%2B8H5XxEwJsdRLwTuigRsy3iC7imacuJlr4JnbKYA7Kx8D%2FoSglmJNdPlzZ9E%2F0%2Bwd4toXp[Compiler Explorer^] [source,c++] ---- @@ -707,7 +707,7 @@ include::example$troubleshooting/fix_rtti_without_dynamic_type.cpp[tag=content] #### `the rtti policy does not deem this class polymorphic` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUsFOwzAM%2FZUoSGgI2BgcEAH2BQg4cWFoylLTWqRJlDiDaRrfjlM6VqA9tH7Pfo7zvJEJUkLvklTieSOx4u%2F0REirXZ11DRxKc3wsGUo%2BR9MBB%2BiMzRWIG%2FSJIuh2Nndzt4cbopDUZLL0zPtYj2ukJi%2FH6Cc%2BgGuBGl99swNg3ITQCeWErhZOt5CCNiC6RKX2mdcliztnQ%2BLec8fN3Al%2BVhgpays%2BCzg6EreigledLXHBdlj0aHMSqq%2F9xbTrRYQaOVpzQl%2F%2BAyn1zpPcBG%2FRICSlYnaELSxMA%2BYtzf6I3SFB5PP06MpjJUJER6OeORT2%2B%2BdoN8L%2Fjl2z9aDnKlCcKVWt%2BYbQLEo42smUQeeu2GV8G9BC7Jx9YQA%2BwGR2o7d6x3PU%2By5Ncf38YnpW6i0uh0shOxMKsWJN3piCTa%2FO5bZo%2B0D9EsnTRNUtr8z0Um4Hx3jChEtb1udV2wQD5iFTyLTn%2BeoKrWOdW3DUicoh8F%2BKW6Lb5XXBn5ztC79f6x0FIA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -739,7 +739,7 @@ how a class, a parameter and a method come to belong to a registry. [#registry_mismatch] #### `registry mismatch` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUl2P0zAQ%2FCuWkU6pLrT0eECYXh8QJ%2FHC5SROvNBT5TrbZIVjW%2F4od6rCb2edpjRAIiXamd3ZtXeOPEAIaE3ggn0%2FcqzpvywZ19I0STZAIVfX15ygYJNXA%2FAKjdKpBrZCG6IH2a03ZmMucBujC2Kx2FnirW%2FmDcY27eZoF9aB6SC2tj6xE2DeOjcIpYCmYUZ2EJxUwIZEIS6ZH3IWdU4qsntLHY8bw%2Bg5oI9JavYrg8WM3bIa9jLpSAX9tOhBp8DEWPsX071sPTRI0QsljOV%2FICF%2B0klWzmpUCEEIn0zEDraqBfUjrM9iH6vq6%2BO2eri7%2F3L3%2BLn6VJzmc3SOPT6XrBgn3broV3mKdclCrOmMp%2Fu8mpXsYLEup%2FPMBukMMyW1LvIhrpij7%2Bx8AWODIoOjorIp5sp%2BY%2FIWle0cavDDwp8IgGdQiZY0OuDMUzTagatshpu3yze5XuNu6hU%2B7CYTB9IkI2Vs%2Bf6G91nbujh6i7%2BmYW7JSct3vJ%2BM8Q0D7nR21V7qABOmStGleOFpPZmWvkkdmDiI8inwvxS1RHPOG4J%2Fcvonen8DQBcI9A%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -765,7 +765,7 @@ include::example$troubleshooting/fix_registry_mismatch.cpp[tag=content] #### `registry mismatch: the parameter belongs to another registry` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUlFr2zAQ%2FitCg%2BJQL1m6hzE3ycNYYC%2BrCyt7WYpR5IstJkvCkrKU4P32nhSndhMbbO777r67k74jtWCt0MrSjPw5UlHif54SKpmqPKsAQ8pvbylCVvuWR%2BCDUFz6EshCaOtaYM1qozZqgGvnjM1ms61GXrfVtBKu9tup0DNtQDXgal2e2BEwrY2JQt4KVRHFGrCGcSAxMcuGzPuQhZ09d%2BRBY8fjRhF89qJ1nknyP4DJhCxJCTvmpcOCblz0KL0lWV%2F7jmleihYqgdELJvTlb1CW%2FcNNFkZLwQXYLGu9cqKBgtfA%2F9rVhdj6YNqr2QJ4MVvgT0vHVYth02GY5Xi0t32%2B5fmvpyJ%2FXD%2F8XD%2F9yL8nJzGDKjtxSEnSty0Woe3NKiXWlXiUp2u7maRkr0WZXi06ieqBI5xJmcRqAvidnBfqeyQB7GW59i5UdhsVHMN1Y4SENprrGQE4APdoiN5tZx6j3nqUB%2BPdfZ5%2FCvVSbMe%2BpPFwArFHTTRtwOZf72gXtLVxvY%2FpRxxmia6df6HdaIzfwoqtDA7eMWlhxOTeGe8GHm8v0KytfAPKRVE6Bq6lsKVQ57wYXOR0z%2Fi%2BAhUrL%2FU%3D[Compiler Explorer^] [source,c++] ---- @@ -789,7 +789,7 @@ include::example$troubleshooting/fix_registry_mismatch_parameter.cpp[tag=content #### `registry mismatch: a class declares an affinity for another registry` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUstu2zAQ%2FBWCvSSIa9fpoSgbB%2BjDQA9tFEBBL3Ug0NRGWpQiCT7SBIb77V3KSqXa0kHYmZ3ljjg7HiAEtCZwwX7uONb0Xc4Y19I0STZAJVcXF5ygYJNXPfAKjdKpBnaFNkQPsrvemI0Z4TZGF8RisbXEW9%2FMG4xt2s7RLqwD00FsbX1gJ8C8da4flAKahhnZQXBSAesbhRg7P%2BQuOjmpyG4snbjbGEbPI%2FqYpGZ%2FMnh2zlashgeZdCTBfiq61SkwMWj%2FY7rnykODVD1TwyD%2FBwnxm5xcOatRIQQhfDIRO6hUC%2BpXuD4atn5y%2FmS3DB7tlvmD6d5qNTodl1lNVzv2U6aOtj0cdyA%2BFUV5VxW365vv67uvxZfq87ePZbkuz3LTLAtmJ%2B7OSZlvWtnOoQbfh%2BKeAHgClegih5S88FQNkeEqB%2Bby7fJN1mvcTvPEe1OZeKSZFLaMLd9f8n2ebV0c8sdfh1ivKG3Ld3w%2FWeMHBtzqnLwHqQNMmCJFl%2BLI08%2FItPRN6sDEfiifAqej6Eg0L319cdSzv6f3L9NzF3g%3D[Compiler Explorer^] [source,c++] ---- @@ -813,7 +813,7 @@ include::example$troubleshooting/fix_registry_mismatch_classes.cpp[tag=content] #### `virtual parameters carry conflicting registries` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUl1r2zAU%2FStCg%2BDQLFm6hzEvycNYYC%2BrCyt7WYpRZNW%2BTJaEPrqW4P32XslO7aU2yNY59557r3RO1AnnQCtHc%2FL7RKHC73pBqGSqDqwWuKX86ooi5HSwPAHvQHEZKkE2oJ23grW7gzqoEW68Ny5frY4aeW3rZQ2%2BCccl6JU2QrXCN7rq2QmwbIxJQsGBqolirXCGcUFSYJ6PkV9iFFYO3JMbjRVPB0XweQTrA5PkXwSzOdmSSjywID0mdNOkWxkcyYfc%2F5j2ubSiBtw9Y8CQ%2Fgrl%2BV%2BcZGO0BA7C5bkNykMrSt4I%2FsftLsT2T8a%2B6S2CF71Fvh86jVqOk47NbKetvc7ztSh%2B3pXF7f7mx%2F7ue%2FEt68WMBeUXJBuKlsbbTRx2tyBTKLaCkPMVnm5%2Fk7M5hmio5kk%2B%2FhHOpMziic2IwXWRxpoRgev8PF0qmPV0JAZRroOPSt1BRQtx3RqQwia33SMgngQP6JDBfmced4MXKY9OvP64%2FhDzJRynRqXptCLxiJro4oitP1%2FTLmpr4wdj0%2FfYzBZtvP5Eu0kbv8DBUUZLPzDpxIQpgjfBjzxeZ6SZrUMrlE%2BidAq8lcKSoM5xaXMR093j%2BwKJJTVu[Compiler Explorer^] [source,c++] ---- @@ -840,7 +840,7 @@ include::example$troubleshooting/fix_registry_conflicting_carriers.cpp[tag=conte #### `the classes carry conflicting registry affinities - list the registry to say which one is meant` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUk1P4zAQ%2FSuWuYDothQOCEORlqUSh11SqWgvFEWuMyTWOrblDz5Uld%2FO2ASSLckhmvfejOfFb0M9eC%2BN9pSR%2Bw2VFX6nI0IV13XkNWBJxeEhRcib6EQG9qQWKlZALqTxwQFvL1d6pXu4CcF6NpmsDfLG1eNahiaux9JMjAXdQmhM9cEOgHFjbR4UvdQ10bwFb7kAkoWM9crzpMKTowjk1uCJm5Um%2BDxJFyJX5C2B%2BwdkRip45FEFbNgOmxYqesK63v%2BY9rV0UEusXlHQtX9BjD2jkwtrlBQSPGMu6iBbKEUD4p%2B%2F3Bk2f7Hu224J3Nkt8R%2Bms9Wyd9ovMxuu9uXnqiiWd2WxmN%2F%2Bmd%2FdFNflr98%2Fl8v5cj9ZG2Wfo7zGAcrTLQrTWqnA5Qt%2FQABeQES8pC4BnzxWXRyoSGE4PpkepX4l18Os0LxwIp5wJgYpYdOzY7pNs40NXbboDx%2BqGSZpekq3gzX%2BSi%2FXKqXqkSsPA6aIwcbQ8%2FhHE81dHVvQIQ%2BlQ%2BD7KDxS6k9dLnY02wd83wHakwm2[Compiler Explorer^] [source,c++] ---- @@ -867,7 +867,7 @@ include::example$troubleshooting/fix_registry_conflicting_affinities.cpp[tag=con #### `cannot tell which registry this class belongs to...` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqdU01v2zAM%2FSuCBgzJ6iZLdxjqpTkMC7DLmgINdlkKw5EZm5gsCfrIUgTZbx9lu43r3GYfDL1H8j3K5JE7cA61cjxlv44cC%2FrOEsZlrsqQl0BHLq6uOEFOBysa4B0qIUMBbI7aeQt5vdiojTrDlffGpdPpVhOvbTkp0VdhO0E91QZUDb7SRcv2gEllTFMoOFQlU3kNzuQCWBOYpufILzGKlIPw7F6T4nGjGD17tD7kkv2N4GjM7lgBuzxITwmnftKDDI6lXe4bpn7OLJRIp2cK6NJfoTT9Q53MjZYoEFya2qA81pCJCsRvtxgUWx6MvfAWwYG3yO8sgipYHrxuG87O%2Fb7qj2LyhzG7XvSNDrtbg60vZCP437IxuZUd3shQ%2BzHUdG%2FRZtL5aOmvq9XjOls9LO9%2FLNffV99GhrR2eEjYqLOYGW%2FnlL5ImPMF%2Fe52tN6PE7bXWIypTBxDoWuDEmwzsU8EwAEEubfdCL%2FwdOrmmYs4zTefZh9jvsRtf9h503Qk9lSTNiFis9sbfoq1tfHdcvBrMnVHqzD7zE89Gz%2FR4VbGtdjl0kGPWQVvgj%2FzdD%2BRzm0ZalC%2BKcr7wGUpkkT1EtccBjGnJ3r%2FATBeTv0%3D[Compiler Explorer^] [source,c++] ---- @@ -891,7 +891,7 @@ include::example$troubleshooting/fix_registry_ambiguous_bases.cpp[tag=content] #### `boost_openmethod_registry must return a registry` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUk1v2zAM%2FSuCBhQJmiVLdyjmJTkMC7DL6gIrelkKQ5EZm6gsCfrIUgTZby%2FluLOXWgeD75GPpPSO3IP3aLTnGft95FjSfz5hXAldRVEBhVxeX3OCvIlOtsAH1FLFEtgCjQ8ORLPa6I3u4ToE67PZbGuIN66aVhjquJ2imRkLuoFQm%2FLMDoBpbW0rFD3qimnRgLdCAmsTs6zP%2FJqyqHOUgd0Z6njcaEbfHl2IQrG%2FCRyN2ZKVsBNRBSo4DYvuVfQs62r%2FY5qXwkGFFL1QQlf%2BD8qyP7TJwhqFEsFnmYs6YAOFrEE%2B%2B9WF2Ppg3bvZEngxW%2BLPS7erFv2m%2FTBLhrrf41ue%2F3oo8vv13c%2F1w4%2F8%2B8hS3Q4PEzbqGhU2uEXqtZowH0q6vvNTXY0nbG%2BwHJNOelZpGosKXOuAJwLgADLSq3WWeOMp6vzBZXLHzef5p1SvcDs0D283SMSeNMlZCZt%2FueGnpG1s6MzGP9JQS7LW%2FJafBmM8osetSjbbCeVhwOQx2Bh6nq440cJVsQEdWlE%2BBN5LUUvUb3ltcJFzeqLzCr9oEB4%3D[Compiler Explorer^] [source,c++] ---- @@ -914,7 +914,7 @@ include::example$troubleshooting/fix_registry_not_a_registry.cpp[tag=content] #### `this class declared its registry affinity after it was first mentioned...` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUu9r2zAQ%2FVeEBsWhWbJ0H8bcJB%2FGAvvSutCyL0sxinyxxWRJ6EeaEty%2FvSfHqd3EBtv33t270%2FkdqAPnhFaOpuTfgYoC37MxoZKpMrASMKT8%2Bpoi5HSwvAW%2BCMVlKIDMhXbeAquXa7VWPVx5b1w6nW408tqWk1L4KmwmQk%2B1AVWDr3RxZAfApDKmFQpOqJIoVoMzjANpE9O0z7yNWdg5cE%2FuNXY8rBXBayesD0yStwgmI7IgBWxZkB4LmmHRgwyOpF3tJ6Z%2BzS2UAqNXTOjKP6A0fcGTzI2WggtwaWqD8qKGnFfA%2F7vlmdhqb%2BzFbBE8m23A58bbeUxZEgX7E3ncSLuHvF9DP%2BliOPfHYX9l2eNTnj2s7u9WT3%2By34nB%2Bq3Yj0ly0W1MnC9wx8f%2FeTUak50WxajViV%2BEMymTmHpFAJ%2Bj07k6zSSCnQjXwcfKZq2icbiujZBgW489IwB74AF90ZnuxGPUOZDy6L%2Bb77NvsV6KzdCetF1DJHaoid6N2OznDW2itja%2BszP9isMs0LyzH7QZjPFXOLGR0chbJh0MmCx4E3zP40%2BMNLNlqEH5VpQOgUspbCnUKa8NznKaZ7zfAbcDMws%3D[Compiler Explorer^] [source,c++] ---- @@ -939,7 +939,7 @@ include::example$troubleshooting/fix_registry_declared_late.cpp[tag=content] #### `std::shared_ptr cannot be passed by non-const lvalue reference` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUl1v0zAU%2FSuWkapUKw0dD2ih6wNiEi8sk5h4oVPkOrfJFY5t%2BaNsqsJv5zpL1wweSaQk95x7ju2bc%2BQevEejPS%2FYjyPHmt6rBeNK6CaKBqjk8uKCE%2BRNdHIA3qCWKtbA1mh8cCC6zVZv9RluQ7C%2ByPOdId64ZtlgaONuiSY3FnQHoTX1MzsBlq21g1H0qBumRQfeCglsaCyKc%2BfH1EUrRxnYraEVj1vN6DqgC1Eo9juB2Zxdsxr2IqpAgn4qulPRs2LUvmK6p8pBg1Q9UcMof4GK4hedZG2NQongi8JFHbCDSrYgf%2FrNyex%2FR5GjDuCMzX2oK98KB3Vlg3uZ0Key%2FHZflXc3t19v7r%2BUnzNL%2Bj0%2BLlg2do%2BjSKp1OuZmtmBkRlN8%2FmOz%2BYIdDNbzYb%2Fpi0mhVJYmM2OWnvPTVEfvLIGjiTQxJGW%2F1Ska0nQWFbghRQ8EwCPISMcdY3XiqRozxmVK2OX71bukV7ibBpAP40jEgTwpnQlbXV3yPnkbG8bA8re0mWuK5%2BoD7yfb%2BI4edypFdS%2BUhwlTxmBjOPP0zxMtXBM70GEw5VPgXytaEvWpbyj%2B6ukf6P4DLp4qhw%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -964,7 +964,7 @@ include::example$troubleshooting/fix_shared_ptr_by_reference.cpp[tag=content] #### `cast only allowed to a shared_ptr` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlU8tu2zAQ%2FBWCBQwbdq06PRRlFB2KGGgPjYI0yKUKBJqiJaIUSfDhJjCcb%2B9SlmLV6a3SQdiZ3Vlyd7THjjsntHKYoJ97LCr4rhYIS6rqQGsOIWbzOQbI6WBZB7wTislQcZQK7bzltM0KVagT3HhvHEmSjQZe23pZC9%2BEzVLoRBuuWu4bXR3ZEbBsjOmEghOqRoq23BnKOOoSCTllXsYs6ByYRzcaOu4LheDZCesDleglgtMZukIV39IgPRQcxkW3MjhE%2Btq%2FmPa5tLwWED1DQl%2F%2BChHyG26SGi0FE9wRYoPyouUlazj75bJB7H9HkQjludUmcb4qXUMtr0rj7euEvuT5j%2Fsyv13ffF%2Fff82vp8f7G1DZiqcFmvaTKFMGu%2FUIZAg56aTx4tkkWxyJfomT2QLttKhml%2F9qUeYP67u7b9frN73OxeNwswky8DlrgLQbegwr0w6lKSrwvMBxSYWKVmO6NUJy27nyEQD%2BxFmA8fU2HXiIes9iFh178XH1IdZLsRkbGnfjjcQONMHtEVt9vsCHqK2N738A%2FB5OewV2X33Ch9ExHoQTGxmtv6XS8RGTB2%2BCP%2FHgoUhTW4eWK9%2BJ4jHwVgpaCjXkdcFZzuER3j%2FxykHZ[Compiler Explorer^] [source,c++] ---- @@ -989,7 +989,7 @@ include::example$troubleshooting/fix_shared_ptr_overrider.cpp[tag=content] #### `a std::weak_ptr cannot be wrapped in a virtual_ptr; use weak_virtual_ptr` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUstu2zAQ%2FBWCvThIa9XpISjj%2BBPSnnqpA4Om1tIiFEmQS7uB4X57l4wcK2lvlQAJOzP74HKOMkFK6F2SSvw8Smz5v%2FgopNWuy7oDDqW5vpYMJZ%2BjqcAHdMbmFsQSfaIIelit3dpd4J4oJNU0W8%2B8j928Q%2Brzdo6%2B8QHcANT79oWdAPM%2BhFooJ3SdcHqAFLQBUYVKXZR3RcWdsyHx4Lnjce0EP3uMlLUVvws4uxL3ooWdzpY44TRN%2Bm5zEmrMfcMMz5sIHXL0zIIx%2FRVS6sAnWQZv0SAkpWJ2hANsTA%2FmKa3Oxf53FQ06guhDk6jdHEA%2FbQLF1%2F3sPbbioMn0M%2BZ5plGwLOdZCcffq3crqfQ%2FxCsRZlVfNrR25Z6NHwJaiNUSjwzALzCZZx89cuY5Gg0jTbHLzZfF55JvcTt1k6xnK8Sea7LVCrb4eiNPpbYPNLpPfuLx7tlri1t5mozxAxNubfHdTtsEE%2BZbppDpwvMFFlrHLg%2FgqBaVU%2BDvUtwS3VlXg3ea0yO%2FfwBPARnT[Compiler Explorer^] [source,c++] ---- @@ -1014,7 +1014,7 @@ include::example$troubleshooting/fix_weak_ptr_in_virtual_ptr.cpp[tag=content] #### `a weak pointer cannot be a virtual parameter; call lock() first` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUstu2zAQ%2FBWCBQIZca06PRRVHR2KBuilcYAGvdSBQFNriQhFEnw4CQz127Nk6Fh93CodqJ2d2V2u5kAdOCe0crQiPw9UtHgu54RKprrAOsCQ8vNzipDTwfIEvBGKy9ACWQntvAU21Bu1USe49964qiy3GvPadotO%2BD5sF0KX2oAawPe6fclOgEVvTCoUnFAdUWwAZxgHkohVdWJ%2BiizsHLgn1xo7HjaK4LMX1gcmya8IFjNySVrYsSA9Csap6EYGR6qs%2FS0zPDUWOoHRExKy%2FBWqqge8ycpoKbgAV1U2KC8GaHgP%2FN7Vx2L%2Fu4pSKA9Wm9L5tnkAdt8Yb1%2F383m9%2Fn7brG%2Burr9d3X5dfykMqnficU6KvIFmhUIcNitX8aJ1PScJzf%2FsbDYney3aWZo4fhHOpCw4usG%2FMF3PLLSpQtxYfUYMHrPjunPb4h%2B9ikTMDbkOPnYZNyoaievBCAk2ee4OAXgEHnA52YTHPEbZkZRHP168X76Leim2U7vStLyY2GNN9HLElh8v6Bhra%2BOzvelbHOYSzbz8QMfJGD%2BEE1sZjb1j0sEksw7eBH%2FKo0NimtkuDKB8KkqnwN%2BlsKVQR14K%2FuCMd%2Fg%2BA1jjOxU%3D[Compiler Explorer^] [source,c++] ---- @@ -1042,7 +1042,7 @@ xref:interop_type_erasure.adoc[Interoperation with Boost.TypeErasure]. #### `requires standard RTTI` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlU02P2jAQ%2FSuWK61Am0LZHqq6LIeqK%2FXSZaWueimryDgmjOrYlj%2FoIpT%2B9h0HB1J6qpYciN%2BbeTMZzztQL70Hoz1l5OeBQoX%2Fs4JQxXUdeS3xSMX1NUXIm%2BhEB7wBLVSsJJmD8cFJ3ixWeqXP8DYE69l0ujbIG1dPagjbuJ6AmRordSPD1lRHdgBMttZ2QtGDronmjfSWC0m6QMbOkZ9SFFaOIpB7gxUPK03wtwMXIlfkTwJHY3JLKrnhUQVMaIdJDyp6wnLuX0yzL52sAU97DMjpJ4ix3%2Fglc2sUCJCeMRd1gEaWYivFL7%2FoxV47imlfYeoDDyBKFwLk%2BbxaG3SQzliUrkqu96ex5wn0Ff9jCoMmTyP4vFx%2BfyyXD3f33%2B4evy6%2FjI5XZLGZDTwXZJQvq5wLXL9UtmIM27laFMf3vFpX44LsDFTFZWPjrkyiiOBKjS5kiMbLHfebkcuOEpj1hYkhabQrndZbmMaCkq5zwhMC8lmKiGPN1uh5PGWfUJFccvN%2B9i7lK1gPTUS7sSdih5rosITNPt7QNmkbG7Lp6Fts5hYtNvtA20EbP8DDWiW7bbjycsAsY7AxnHm8tURzV8dG6tCJ0iHwrxSWBN3HdYeLmPYJnxeNwXRS[Compiler Explorer^] [source,c++] ---- @@ -1068,7 +1068,7 @@ include::example$troubleshooting/fix_any_custom_rtti.cpp[tag=content] #### `virtual_any must be passed by reference` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUl1v0zAU%2FSuWkaZUKw0dD4hs3QNiEi8sk5h4oVPkOrfJFY5t%2BaOsqsJv5zpN1zAeSaQkPufcc%2B2bc%2BAevEejPS%2FYjwPHmt7LOeNK6CaKBmjJ5eUlJ8ib6OQAvEEtVayB3aDxwYHobtd6rc9wG4L1RZ5vDPHGNYsGQxs3CzS5saA7CK2pj%2BwEWLTWDkbRo26YFh14KySwQVgUZ%2BV1UlHnKAO7N9TxsNaMrh26EIVivxOYzdiK1bAVUQUq6KdFDyp6Voy1fzHdvnLQIK32JBjLX6Ci%2BEUnubFGoUTwReGiDthBJVuQP%2F3tyex%2FR5GjDuCMzX2oK6H3L6P5VJbfHqvy4e7%2B693jl%2FJzZqlwi89zlo2Hr8aSOaMPGtrxB13M5mxnsJ4N20tfTAqlsjSIC2bpOXs1xJMP02lIq0FzfVSMPbPEjG2kiSF592udsiJNZ1GBG2L1RAA8g4x0%2FjFnJ55WY%2Bi4TJG7er98l%2BoVbqaJ5MN8ErEjT4prwpYfr3ifvI0NY4L5W9rMivK6%2FMD7yTa%2Bo8eNStndCuVhwpQx2BjOPIUg0cI1sQMdBlM%2BBf61opaoT7ph8UrTP9H9B%2F7vMAk%3D[Compiler Explorer^] [source,c++] ---- @@ -1092,7 +1092,7 @@ include::example$troubleshooting/fix_method_takes_virtual_any_by_value.cpp[tag=c #### `an owning type_erasure::any must be passed by reference` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqdU02L2zAQ%2FStChSVh06TZHkq1Tg6lC710s9Cll2YxijxxRGVJ6CNNWNLf3pGtxO7updQBO3rvzRtpRvNMPXgvjfaUkR%2FPVFb4nU8IVVzXkdeASyqurylC3kQnWuCN1ELFCkghjQ8OeLNc67Xu4V0I1rPZbGOQN66e1jLs4mYqzcxY0A2Enak6dgBMd9a2RtFLXRPNG%2FCWCyCtkLFeeZtUmDmKQO4NZnxea4LPXroQuSK%2FEzgakwWpYMujChhwGgY9qOgJy7F%2FMc2xdFBLXB1RkMMvEGO%2F8CSFNUoKCZ4xF3WQDZRiB%2BKnX57N%2BlJ0h2ysmu1BYC3yIV8KwtFCCY776GDG9fFfZJsoVZD6lfT%2Fqj%2BTOoAztiPKYaZLY%2FqWBMDi5r4Mpbd9%2F%2FAUpU4FXnTNCcAYYkWOwpIw1tWkSJQw9lgKk%2FsgNwqK5aQNcqD4AarlsjX%2FtFp9eyxXD3f3X%2B8ev6w%2BjyzabeVhQka5%2FWVxTo0GPlR4c7pbejWekL2R1bg1Sv%2BI4EqN2qyX%2FV6R9B6f71S2HyUw2wkTQ%2FI4rXUaDGEaKxW4doaeEIADiIjnykN15nGVJ4yKNF837%2BfvUrySm%2BH40bZAidijJ85mwuYfb%2BgpeRsb8rjSt7iZBQ7n%2FAM9DbbxXfpUPVRsufIwYFYx2Bh6HiudaO7q2IAOrSkdAq%2BtMKXUZ127eKE5PeHvD0CtiPc%3D[Compiler Explorer^] [source,c++] ---- @@ -1116,7 +1116,7 @@ include::example$troubleshooting/fix_method_takes_erased_by_value.cpp[tag=conten #### `do not wrap a virtual_any in a virtual_ptr...` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUk1PwzAM%2FStRkNAmYGVwQIRtPwE4cWGoylLTWqRJlI%2FBNI3fjlM6VsaR5lD5vWc7dt6WBwgBrQlcsOctx4r%2B03PGtTR1kjVQyNXZGSco2ORVB5ygUTpVwGZoQ%2FQg28XSLM0BbmJ0QRTFyhJvfT2pMTZpNUFbWAemhdjY6psdAJPGua5QCmhqZmQLwUkFrBMKcVDeZRV1Tiqye0sdt0vD6Fujj0lq9pnB0ZjNWQWvMulICbth0qNOgYk%2B9xfTbkoPNVK0IUGf%2FgMJ8U6TzJzVqBCCED6ZiC2UqgH1Fhb7Yv9dRYEmgreuCLEqpdn8rGZtsWLOEz3qhy17ySkzNM34aBWli352pFwwN%2Bq0eStLk99W2dahBt%2FZ4IUA%2BACV6L69L%2FY8Rb1JuMoWubqeXuZ8jauhg3g3TybWVJPslbHp7RXf5drWxd5x%2FIKuNCd%2FTW%2F4bnCNJwy40tlrr1IHGDAPKboUDzw9Wqalr1MLJnZF%2BRD4W4paotnruuBIs3uh8wXKgBZy[Compiler Explorer^] [source,c++] ---- @@ -1139,7 +1139,7 @@ include::example$troubleshooting/fix_wrap_virtual_any.cpp[tag=content] #### `use of deleted function ... final_virtual_ptr` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUttO4zAQ%2FRXLK62KWBrKPqzWXD4BeOKFosh1pslonbHlS6GqyrczDinNwiPxQzTnzJwZj89ORogRHUWpxONOYsP%2FxS8hraY26xY4lOb0VDIUXQ5mAH4gGZsbEFfoYgqg%2B5slLekIdyn5qKpq5Zh3oZ23mLq8mqOrnAfqIXWueWcnwLzzfhDKEakVpHuIXhsQQ6JSx8zLksWds0ni1nHH3ZIEfxsMKWsrXgs4OxHXooG1zjZxwX5adG9zFGqs%2FY%2Fpt3WAFjnacsJY%2FgEp9cw3ufLOokGISoVMCXuoTQfmX7w5iH13FRVSguB8FVNTa9p%2BrGbjsBE%2BMD1jSinmfgria5wcdrBG0rYeN1H7FGYDXTawpPKOxvUeLYThyZ8YgBcwmWcbPXDgORoNIU2xw8XvxXmpt7iaukUOsxdiw5pspYIt%2Fl7IfdF2Po3ukmc88DV7afFH7idjPGDElS2%2BWmsbYcLc5eRzOvL8QIXWoc09UBpE5RT4KsUtkQ55Q%2FApZ%2F%2FE5w0Y8w4o[Compiler Explorer^] [source,c++] ---- @@ -1167,7 +1167,7 @@ include::example$troubleshooting/fix_final_virtual_ptr_any.cpp[tag=content] #### `no matching function for call to ...cast` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUtFu2yAU%2FRXEpChRsmTpHqZSNw9TI20Pq6uu6ktdWQQT%2B2oYkIGsUZR9%2By6O3Xjd3mYerHvOvQc4nAN10jkw2lFGng4UCvwvZ4QqrsvAS4klFdMpRciZ0IgWeAdaqFBIkoBxvpG8XmU602e48t46tlhsDPKmKecl%2BCps5mAWxkpdS1%2BZ4sQOgHllbSsUHOiSaF5LZ7mQpG1k7Nx5Fbtw5yA8uTW44yHTBL8dND5wRX5FcDwh16SQWx6Ux4HjcOhOBUdYN%2FsHU%2B%2FzRpaA1R4buvFXiLGfeJPEGgUCpGOsCdpDLXNRSfHDrXqx%2F7ViAdrLxtgTkXO9fzXnc5p%2Bf8jTu%2FXtt%2FXDl%2FRmbLFjCy8zMu6unycCH9T3tuHwaDUjzhdo4em5RpMZ2RkoJlf%2FUszTx%2FX9%2Fdeb9UA6GjZ6I0KM63X6BzCOJAnJ6DSj0fJMx%2BAIU1tQsmkz9oyAfJEioBld6Hoeqy6BVMT8XXxcfojzCjbDeNL2XpHYoSZmN2LLywt6jNrG%2Bi7O9D2e9hrDu%2FxEj4NjPIKDjYpB3nLl5IBJg7fBn3lMRKR5U4Zaat%2BK0iHwtxRuCbrva4s3PcdnXL8BcV8w7A%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1197,7 +1197,7 @@ See xref:registries_and_policies.adoc[Registries and Policies]. #### `+the `state` of a policy that defines `initialize` must be copyable...+` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlVMGO0zAQ%2FRUrSKtWW1K6HBDZbiRYKnGAzYquuNBV5TpuOsKxQzwuW6rw7YzdtAmFAxLtoZ03b96Mn8beR1ZaC0bbKGFf9hHk9DsZsUhxXTheSAojcXkZEWSNq0UAnoEWyuWSTdFVSqYLvdAdBsZiLXl5Bm8QK5uMxytDeVMXcQG4casYzNhUUpcSNyY%2FZHtAvKmqIOQs6IJpXkpbcSFZICZJx7z2LOrsBLI7Qx33C83os4UaHVfspwcHQ3bDcrnmTiEVNP2ie%2BUsS9ra3zLlblnLAijaEaEtP0FJ8p1OMq2MAgHSJkntNEIpl2IjxVebHsU6K0pZmnqX%2Fr87Y9CAwBX8kCej2pkFp%2FbLMNTuaMXBQ8FRFtSfnOiTwoyehbKsFHGmQnFr2af2mOkh28qv9VG0B1qksj5%2ByOVJ4jR8c9QJ6yloTFnOkV93vObU%2FC8D3BqN8glHLIRxHLOsQr%2ByaX8AjiDY1kDOOk8Gglh4FLgghRCHicLmTlslEk0vhv3Jm8Pf5nxJgmP5P6xD39rTCrzNsvnDMruf3X2cPbzP3i1vP7yZz2fzgV%2B6UdjA0XmLYag8nWxwGrM75%2FSsJB34IjqCv7bClBUoWYcb%2FkiAfJLC0Y61V%2F6Yp6i9%2F5Hwt%2F%2Fq5eSFr1ew6j8OUdhBn9iSJpnnscnrq6jx2ubgp8eek8039HRMXkVNb4zPYGGl%2FDOy5srKXiZzWDns8mS4T%2FO6cKXUGESjPvCnFLUEfeSF4IzTPNL3Fx4ntPk%3D[Compiler Explorer^] [source,c++] ---- @@ -1222,7 +1222,7 @@ include::example$troubleshooting/fix_policy_state_not_copyable.cpp[tag=content] #### `+the `state` of a policy that defines `initialize` must be nothrow move-assignable...+` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlVF1v0zAU%2FStWkKaOdSkdD4jQRoJRiQdYJjrxQqfKddzEwrEjf4x1VfjtXDtuk2YCIZE%2BNPfce879iH33kaZaMyl0lKDv%2B4jl8D8do4hjUVhcUDAjcnERAaSlVcQDL5gg3OYUzYytOU1XYiU6jEltFMXVAC6NqXUymWwk%2BKUq4oKZ0m5iJieypqKippR56%2B0BcVnXXshqJgokcEV1jQlFPjBJush3LgoyW2LQjYSM%2B5VA8DwwZSzm6JcDR%2BdojnK6xZYbIDR90i23GiWBe%2BKpdmtFCwbWDgIC%2FQglyU%2FoZFZLzgijOkmUFYZVdE1KSn7o9CD2v6OYMMEMw5w90eNUQoEEQ661r2B36LsdGMGGFhLqnp8E%2BYJclKFVzSFmRjjWGn0NPaWtN8hvxUG0B2oDtD7e%2BgAcDPm5n8B5CwJnf47F1kgE7SsMM5oPSJdpeD2h%2F1WgjT%2FhDqp3j6LGKoFempLpQUFNZzYnyQZDvJbC0EczRt6M4xhltXF3LO0PERtG0INkOeq%2Ba2gyCJyBQmg6TxJ%2F1WZBCURT6KRXfyiuGZ5q%2F9Xzfzi%2F%2FeNxPLMfsmx5t85uFzdfFnefso%2Fr68%2Fvl8vFcuRuydhfmfEwxblnHjsbHcvs%2BpwNKOnIkaAFt2eIrGrGqfIr6R4A%2BkgJfEoVdtTBD1ZYWBFx6%2Brq9fSV43O26W%2BzyN8j53gATRiew6Zvr6LGact2ng67hDHPYddN30RNr4xvTLMNd3tvi7mmPU9mTW1N54eBOzdWha2oMF406gPPpSAlE4c4bwximnv4%2FQZcTeOv[Compiler Explorer^] [source,c++] ---- @@ -1246,7 +1246,7 @@ include::example$troubleshooting/fix_policy_state_move_may_throw.cpp[tag=content #### `two or more stateful policies in this registry share the same nested state type...` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNq9U11v2jAU%2FSuW99KqDEr3MC0FpH0g7WFrqlH1pVSRcS6JNceO%2FNENofS379pJSqCa9jZ4QD7n3OOD7bOnFqwVWlmakIc9FTn%2BTkeESqYKzwrAJeUXFxQhq73hEXgjFJc%2BBzIT2joDrFqs1Vod4NK52iaTyUYjr00xLoQr%2FWYs9ETXoCpwpc5bdgCMy7qORt4KVRDFKrA140CiMEkOyuugwp09d%2BRG4477tSL4eRLGeSbJcwDPzsmc5LBlXjocaIZDt9JbknSzR0y1ywwUAlc7FHTjL1CS%2FMJ%2FMqu1FFyATRLjlRMVZLwE%2FtMuTsy4RhpMH08oRxSGujyNw5mUNouuu17cHgJnDgqNWeZHojgcVA6qWqJmxiWzlvzoci5atrPfqt70YGwdTgXXNuJ1yzenycAYbf4Z7Uj137JFGvWDC2uVf7m14QGOjjO%2FXNynNF3dZent8ub78u5r%2BiX7%2FO3jarVcnYWnMorvZvR643OcDRXhuqqFBBPb9IgA%2FAbusQFdvXoeV13XKA9Nu3o3vQzzUmyGRaTx4QfiCT2xpQGbfriiTfDWteuKS99al8%2BxptP3tBnEuBdWbGSo7JZJCwMm9a727sDjgQaamcJXoFw0pUPgtRVuKVSvi4sTTfOI3z8%2B1ISL[Compiler Explorer^] [source,c++] ---- @@ -1271,7 +1271,7 @@ include::example$troubleshooting/fix_policy_shared_state.cpp[tag=content] #### `+the type_hash policy must appear before vptr_vector in the registry's policy_list+` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUstu2zAQ%2FBWCvSSIa8XpoSjrGOjDQA9tFMBBL3Ug0NRaWoQiCZFMaxjut3cpy7aa5BbqIOzMPgez5R68R2s8F%2BzXlmNJ%2F8mIcS1NFWUFFHJ1ccEJ8ja2qgPeoFE6lsCmaH1oQTazpVmaE1yH4LzIspUl3rbVuMJQx9UYbWYdmAZCbcs9OwDGtXNdo%2BjRVMzIBryTCliXKMQp82PKoslRBXZjaeJ2aRi9R2xDlJr9TeDZObtmJaxl1IEKdsOiWx09E33tf0yzKVqokKINJfTlR0iI33TJ1FmNCsEL0UYTsIFC1aAe%2FOzQ7LVSZIcJWYMGG6kLB%2B0aVChq6eujUP3OCYNysPdejZeXtzEM9g8bB13PWX%2FavjS9U9JLO0xnx2M%2F5%2Fnirshv5zc%2F5nff8q%2FFl%2B%2BfFov54izJO%2Bq0Hj3d8Zwqk6mUbRxqaDv%2F3RMAf0BFEqo35IGnqHcnV8mbV%2B8ml6le42poXd4JmYhH6km%2BTtjkwxXfpd7Whd7q%2FK0P5TUZe%2FKe7wZr%2FESPK51Mvpbaw4DJY3AxnHhSPtGyrWIDJnRN%2BRB43opGojnkdcGTnN09ff8AdmBAow%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1297,7 +1297,7 @@ include::example$troubleshooting/fix_policy_order.cpp[tag=content] #### `minimal_cover_hash needs BMI2...` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUk1vEzEQ%2FSuWubRqyJJyQJg0Eh%2BROEC3UioupFo53unuCK9tre1CFaW%2FnbG7SRZy4MD6sJr35vPpbbkH79EazwX7vuVY0382YVxL00TZAIVcXVxwgryNvcrACzRKxxrYHK0PPchusTZrc4TbEJwXRbGxxNu%2BmTYY2riZoi2sA9NBaG39zI6AaetcbhQ9moYZ2YF3UgHLiUIcM9%2BlLJocVWDXliZu14bR94B9iFKzpwSenbMrVsO9jDpQwW5cdKOjZ2Ko%2FYPpHqseGqTokRKG8gMkxE%2B6ZO6sRoXgheijCdhBpVpQP%2Fxi3%2Bx%2FpSj2E4oODXZSV8o%2BQF%2B10rcHmYaNMwP1aO1nMf65%2B2nr%2BeJwwYeyXN1W5c3y%2Buvy9nP5qfr45f1qtVydJc0mWcDJyehzKk1WUbZzqKHPrrojAH6BinT%2BYLM9T9HgOa6S4y5fz16leo2bsSF5licRNC65NWGzt5d8l3pbFwYD85c%2B1Fdk19kbvhut8Q09bnSy7r3UHkZMGYOL4ciToomWfRM7MCE35WPgtBWNRLPPy8FfObs7er8Bi9MyqA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1330,7 +1330,7 @@ The examples need a compiler that supports reflection, such as GCC 16 with #### `a group holds reflections of namespaces, classes or registries` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUUtP20AQ%2Fiur7QVESRQOSGxDDlWjtodiBBGXBqzNemKPut5d7YOCIvPbmTUOMW18iOZ7jT3fjgcIAa0JXLDfO44V%2Fc8%2BM66lqZOsgUauTk44QcEmr3rgExqlUwVsjjZED7JdrM3aHOAmRhfEdLqxxFtfT2qMTdpM0E6tA9NCbGz1xo6ASeNcH5QCmpoZ2UJwUgHrhUIclF%2ByijYnFdmVpY27tWH0e0Qfk9TsJYNHx%2BySVbCVSUcydGPTtU6BicH7gWmfSw810vRMgsH%2BDgnxl75k7qxGhRCE8MlEbKFUDag%2FYbEP%2B1oUt6uyuF5e%2FVqufhTfypvl95%2B3q%2BXN0VsS%2BFJpGej4893DA5rYLY7JmM%2BsbOtQg%2B8buScAnkAluuJQ0Z6naeiL17PzWbZq3Ix75P3dMvFIcVRyxmYXZ7zLsdbFoXd%2BGmJ1SS2fnbPTrYetBpU53o1e5w4DbnSufyt1gBFTpOhSPPB0x0xLX6cWTOw38DHwfxTtR7PX9cM%2Fmu6enleUP%2Buy[Compiler Explorer^] [source,c++] ---- @@ -1354,7 +1354,7 @@ include::example$troubleshooting/fix_register_classes_not_a_class.cpp[tag=conten #### `a group holds one kind of reflection...` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUk1v2zAM%2FSuCdmnRNkF6KDAtzaFYsO6wumiDXZbGUGTGJipLgj66FYH320e5zuKt1kHge%2BQjzac9DxACWhO4YD%2F2HCu6Z%2BeMa2nqJGugkKuzM05QsMmrHviARulUAZujDdGDbBdrszZHuInRBTGdbi3x1teTGmOTthO0U%2BvAtBAbW72xI2DSONcLpYCmZka2EJxUwPpEIY6Zn3IWdU4qsjtLHfdrw%2Bh7QR%2BT1Ox3Bk9O2TWrYCeTjlTQjYvudQpMDLX%2FMO1r6aFGil4pYSj%2FCwnxk%2F5k7qxGhRCE8MlEbKFUDajnsDiI3RTF46os7pd335ar2%2BJz%2BbD88vVxtXw4eVMCXyotAy1%2Fvt9s8hjnbLPJU%2BV7NEO3OCXBvH5lW4cafO%2FUEwHwC1Si7Q7WHXiKBh95Pbua5VKN27G%2FvN9nJl5IjszP2OzjJe%2ByrHVxeA%2F8IsTqmty%2FvGIXOw87DSpzvBuN8x0DbnV%2BFjupA4yYIkWX4pGn%2FWZa%2Bjq1YGLfgY%2BB91LUH80hrw%2F%2By%2Bme6PwBIkz0Xw%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1377,7 +1377,7 @@ include::example$troubleshooting/fix_register_classes_mixed_group.cpp[tag=conten #### `order the groups as namespaces, classes, registries` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUstu2zAQ%2FBWCvSSIY8M5BCjr%2BFDUaHtoFCRGL3Us0NRaWpQiCT7SBob67V0qcq2k0kHYmdlZaocHHiAEtCZwwX4cOFb0nU8Y19LUSdZAJVcXF5ygYJNXPfAOjdKpArZAG6IH2S43ZmNOcBOjC2I221nira%2BnNcYm7aZoZ9aBaSE2tnphR8C0ca43SgFNzYxsITipgPVCIU7KD1lFk5OK7NbSxMPGMHqe0MckNfuTwbNzdsMq2MukIzV046Y7nQITQ%2B8rpn0uPdRI1TMJhvZ%2FkBC%2F6E8WzmpUCEEIn0zEFkrVgPoZlkezj0XxsC6Lu9Xtt9X6S%2FGpvF99%2FvqwXt2fvTiBL5WWgZa%2FOGy3o5ndhBGQzzVh220%2BZrc8J8scgLKtQw2%2Bz%2BqRAPgNKtF%2Bh%2FCOPFVDkryeX89zq8bdOGHebzQTT2RH8Wds%2Fv6Kd9nWujjcCH4ZYnVD%2BV9ds8u9h70GlTnejY7zHQPudL4Ye6kDjJgiRZfiiacNZ1r6OrVgYj%2BBj4H%2FrWg%2BmqOuL95oukd6%2FwJ9p%2FVX[Compiler Explorer^] [source,c++] ---- @@ -1400,7 +1400,7 @@ include::example$troubleshooting/fix_register_classes_group_order.cpp[tag=conten #### `a listed class must be complete` -*Example* +*Example* - link:https://godbolt.org/clientstate/eNplUk1PGzEQ%2FSuWewEBicIBCTfkUDWiPcAiiHppyMrxTnZHeO2VP6Ao2v72js3SbOn6sJr3Zt7Y82bPPXiP1ngu2M89x4r%2Bs1PGtTR1lDVQyNXJCSfI2%2BhUBj6hUTpWwOZofXAg28XarM0BbkLovJhOt5Z46%2BpJjaGJ2wnaqe3AtBAaW72xI2DSdF0Wih5NzYxswXdSAcuJQhwyP6cs6hxVYLeWOu7XhtH3jC5EqdnvBB4dsytWwU5GHaigHxfd6eiZGGr%2FYdrX0kGNFL1SwlD%2BFxLihV4y76xGheCFcNEEbKFUDagnv%2FggdoP0lgx8KYqHVVncLW9vlqtvxdfyfnn9%2FWG1vD96kwZXKi09uTHfbzbpXqdss8n1%2FeKYJJIDyrYdanDZrEcC4BeoSAMe3HvnKRqs5PXsYpZKNW7HFvM80kQ8kxz5n7DZ5Tnvk6ztwrAS%2FMyH6ooW4PyCne0c7DSoxPF%2BdJ0f6HGr02bspPYwYooYuhgOPE0l0dLVsQUTcgc%2BBv6Xov5o3vNy8CGnf6TzB4fY9aE%3D[Compiler Explorer^] [source,c++] ---- @@ -1478,7 +1478,7 @@ xref:reference:BOOST_OPENMETHOD_CLASSES.adoc[BOOST_OPENMETHOD_CLASSES]. So must the class of every object passed as a virtual argument. cpp:initialize[] detects the first two omissions: -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUl1vm0AQ%2FCur6wtWXKjTh6o4iZTWSK3UliqO8pJE1gEXvMpxh%2B7DqWrR3949jG2U%2Bq3wADuzM%2Byxs2VWWItaWZbC%2FZZhRc%2FZFJjkqva8FlSy8uyMEWS1N2UPvEFVSl8JuFg719o0SQqtrdOmjmt0a1%2FEqBPdCtUIt9bVjh0B8bptrx7U%2F9okqNAhl%2FhbDI5jT%2BsMqroHvaU3ULwRtuWlgN4oTY9O89BFAl86uFbYcAnbBwV0bdA4T%2BWfHRxN4BIq8cS9dCTq5gfZQteQHsRd7%2Fgpz5e3q%2Fxn9uN7dvslX6w%2Bf7teLrNlRM2TOSTJvh8tNGjDlKdkUaufxRSiYZZV68zFTng1mcJGYzU5%2Fbn8Lru5%2BbrIThnQCAf1%2FrA0UBzHdKzghspBw1FFY5oX2jgLL7QeEMZoA%2FRPLeUkBa%2BelX5RUEpu7XCwne64pigMSu4hTqVuWpTC9Ml7JED8EqWn7Q9R3PNUDblkZUjl%2BfvZu6CXWIxDy%2FqlBmJDnpTogM0%2BnrMueOvWDSFnb62rLinSsw%2BsG41xhxYLGeL9xKUVIyb3rvXuyNO%2BA81N7RuhXG%2FKxsC%2FVvRJVPu%2BvnjV0z3S%2FReOuDN3[Compiler Explorer^] [source,c++] ---- @@ -1487,7 +1487,7 @@ include::example$snippets/errors_missing_class_method.cpp[tag=classes] include::example$snippets/errors_missing_class_method.cpp[tag=init,indent=0] ---- -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlUl1v00AQ%2FCur48VRg03KA8JpKxUSCSTAqKn60lbR2b46q57vrPtIEZH57ezZTmKVvBE%2FxDuzM7fnnR2zwlrUyrIU7ncMS%2FqfTYFJrirPK0ElK87OGEFWe1N0wBtUhfSlgIuNc41NkyTX2jptqrhCt%2FF5jDrRjVC1cBtd9uwIiDdNc%2FWg%2FtcmQYUOucTfYnAce1pnUFUd6C29geK1sA0vBHRGaXp0mocuEvjCwbXCmkvYPSig3xaN81T%2B6eFoApdQiifupSNROz%2FIFrqC9CBuO8dPWba6XWc%2Flz%2B%2BL2%2B%2FZIv152%2FXq9VyFfVtkzkkSSdECzXaMOUpWdToZzGFaJhl3Thz0TtcTaaw1VhOTh%2BX3S1vbr4ulqcM6NiDen9ZmiaOY7pWcEPloOaoojHNc22chRdaDwhjtAH6ppZykoJXz0q%2FKCgktzbcqhcddxSFKck6ZKnQdYNSmC52jwSIX6LwtPohh3ueqiGUrAiRPH8%2Fexf0EvNxYlm30UBsyZPiHLDZx3PWBm%2FduCHh7K115SXlefaBtaMx7tBiLkO2n7i0YsRk3jXeHXladqC5qXwtlOtM2Rj414qORLXv64pXPe0jPX8Brb8yPw%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1500,7 +1500,7 @@ The third one can be detected only during the call, and only if runtime checks are enabled. Otherwise, the call reads a v-table pointer that was never set up, and the behavior is undefined: it may call the wrong overrider, or crash. -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlU11vmzAU%2FSuW%2B0LUDJbuYRr9kPKB1GptmELWl6VCDrjkqsZG2E6nRdlv3zUkBLV9GzyAz7nn%2BNr33h3VXGtQUtOQ%2FNpRyPE7GhIqmCwsKzguaXZ%2BThHSytZZA5zl%2FBkkJ5M4TpZp%2FCOaP0TL23iWRvPx5D5KFz%2Fny7uHKJ3eRtPvyUqu5BnITNick6uNMZUOg2CtlDaqLvwCzMaufVCBqrgsudmovGV7gL%2Bpqpv%2FtwlAggEm4A8%2FOPY9talBFg1oNf4RyUquK5Zx0hiF4cnp0kWhwGaGjCWUTJDdShJ8tlAbi8u%2FLewNyDXB%2B2JWGBTtLzvZTBUk7MQ9YmKFyBvShTTMSgZBh4MmJWiX4Uq%2BK8H0fpwkUeK1vkNnMWgM3kZ6lXrhQ%2BId8k0rU1%2B1opvBkGwV5B%2Fr0vgxWizuZtFHBrhbpz5eCGbu%2Bz4e3bmBNKRkIL2OPpXEazd04PGoG55hdTsYrdha1UaTVyw34XWtaoI10tipIbHyRapXSTLBtD5atEKXqteauU0wFdfRmSorELxumv8JAf6bZxZjDtNw5HF1GA2aucG4%2BDL67PQC1v25oU2XOGKLnjhUDht9u6B7560qc5gz%2Bkmb%2FBqnavSV7ntpPIKGtXAT9syE5j0mtqay5sRjnzia1YUtuTSNKe0D761wS5DHuGbxJmb%2FhO8%2F0z5fMQ%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1535,7 +1535,7 @@ that are registered separately are unrelated, as far as OpenMethod is concerned. If an overrider implies that one derives from the other, `initialize` reports it: -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlU9tu00AQ%2FZXR8uKoqU3KA8JJKxUSCSTAqKn6QqtobU%2FtEfautZdCCeHbmXVuVql4wX6w53LOzO6cWQuL1pJWVqTwdS2o5O9kDKKRqvKyQjZFcXIi2GW1N0XveEGqaHyJMKud62yaJLnW1mlTxRW52ucx6UR3qFp0tS630YEjrrvu4lb9L01CihzJhn7ijnHIaZ0hVfVOb%2FkPlGzRdrJA6InS9Mg0DVkM8IWDS0WtbGB9q4CfBzLOs%2Fl7645GcA4l3kvfOAZtpgfYXFeQHsCbnjFJwGBF1qHBEix20kiHzeMYrAZXI5Cq0ZCTipsiCwof0HAeMvZtli2vV9mXxedPi%2Bv32Xz17uPlcrlYRtsSo%2Bk%2FUriXUd%2FA04yo099wDNHuVKvOmdmW72I0hgdN5fO4VXazuLr6MF88R8DVDuj9tfHJ4zjmCwpspBy0klQ0DMtcG2fhOw8a0BhtgKdjWXEptGT7geXS4v5GT2e%2FwhVv4ce5R6FfLhL0Wei2owZNL%2BU7duAPLDzLaaftfZytndBFEWR%2B9mryMuAbyodbIHqVhAAPJaxI8E3enIlN4Nad222NOLWuPOcdmbwWm0EbN2Qpb8K%2B3MvG4iCSedd5d4yzgEJYmsq3qFxPKoaOv6m4JKl9Xm88ydnc8fsHN11PHQ%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1565,7 +1565,7 @@ Error type: cpp:no_overrider[]. No overrider is applicable to the dynamic types of the virtual arguments: -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlU01vm0AQ%2FSur7QUrDtTpoSr5kNIYqZXaUsVRLnFkLbDGoy67q%2F1wo1jub%2B8sYIxS3woHNO%2FNe7MDjx213FpQ0tKUPO0oVPicTQkVTNae1RxLWp6dUYSs8qZsgXcgS%2BErTq42zmmbJkmhlHXK1HENbuOLGFSiNJcNdxtVdewIiDda3yzl%2F9okIMEBE%2FDKe8el9BZkTSRruNWs5KTVpOlRdBm6rDO%2BdORWQsME2S0lwWsLxnks%2F3RwNCHXpOJr5oVD0f5ykM1VTdJBPCLumHtDLOXnPF88rPKf2Y%2Fv2cOXfL66%2B3a7WGSLqGubBrdpUE5Otkda%2FeJTEvWHW2lnrjrlzWRKtgqq07pV%2Fpjd33%2BdZ6cMcOSgPmyfJCSOY9wzuIF0pGEgo4E%2BvuqoGxjAsO%2BaC3gZEHRhhTLOkt%2F4BQk3RhmC38JilFIilSPQaMEbLh2vOkk4X9S6BGMcH7JWqkaD4KaN5TMC%2FIWXHqPR5%2FTAY9WHlpYhshcfZu%2BDXkAxTjRtYxCILXpi3AM2%2B3RB98Fbadf%2FAfTcuuoa8z77SPejYzyChUKE7K%2BZsHzE5N5p7448BiHQzNQ%2BLNma0jHwrxWOBHnoa4s3PftnvP8Cn607wA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1600,7 +1600,7 @@ Error type: cpp:ambiguous_call[]. Several overriders are applicable, and none of them is more specialized than all the others: -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlU9tunDAQ%2FRXLfWEVCt30oSq5SGkXqZXaUmWjvGSjlQEHRgLb8iW9rOi3dwwsS9pV1arwgObMnDNjM2dHDTcGpDA0IXc7CiV%2BlyGhDROVYxXHkBYnJxQhI50ueuAZiKJxJSfntbXKJHGcS2ms1FVUga1dHoGMpeKi5baW5ZCdAVGt1OVG%2FK9MDAIssAa%2B81FxI5wBURHBWm4UKzjpOUlyIJ35KmO1Kyy5EtCyhuw2guDzCNo6DH8McLAgF6TkD8w1Fknd2URbyYokE7nrFd9k2fpmm31OP31Mb95lq%2B3bD1frdboOhrLQkxZHK4OWcxuSYGy%2FVVafD6TLkBwBF4hKKI%2BLbbPb9Pr6%2FSr9a1Wca5Lc30QckyiK8Mz%2F3MKr%2FXHqoy1AWNIyEMGUPvzZYDioB%2F29GyGl%2BhaSmhe4KFMK5VgutTXkC24O4VpLTXAHDK5wQlibQ%2BWkM0Oxnzt4KuSb4Ch%2BzQvZKmi47h1xjwD%2FyguHNaNF9nmMRr%2FQwrvl9OXyhec3kM%2FNRPsN9IlH1ESneWz5%2BpR2XlsqO5qPPje2vECrLV%2FRbjbGLRjIG2%2B7B9YYPstkzipnD3lcTp9munItF7YXpXPgdylsCWJf1we%2F1HT3%2BP4EOIBl2A%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1652,7 +1652,7 @@ Error type: cpp:not_initialized[]. A method was called before cpp:initialize[]: -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqNU11vmzAU%2FSuW%2B0LUjCzdwzT6IaUJUqu1YQpZX5YKGXDI1cC2sJ19RNlv3zWQBK15GDzAPfecY1%2F5eEc11xqk0DQg33YUcvyOh4SWTBSWFRxLml1eUoS0tHXWABewFjlfk%2FsoipdJ9CWcP4fLh2iWhPPJ%2FVOYLL7Ol4%2FPYTJ9CKef45W4QDII%2Fv98LnJYrwT%2BgchKm3NyszFG6WA0SqXURtaFX4DZ2NQHOZKKi4qbjczbbg%2FwN0rdOSOrQRREsIprxTJOGmIQnJjXjqVNbTNDJgIqVpLdShB8tlAbi%2BWfFvYG5JbgQMyWBkX766NsJgsSHMX7xvHNyNOnSRyHsdfShk40OMv0lPzOh8Trlk%2BUqW9a0d1gSLYS8vO6JHoJF4vHWXjOAFc7qg%2FzjUbE932cxLmBMKRiILx%2BGwQYYCX85ghvmCZCGpJyLkjGypLnLdGNr4WU6lezr07LUlkbTX7gaRFe17ImeAQakxU0LifrzsVt2mtt3Hy4KZe9TFYKSl43MX1FgP%2FkmcUcdLk99LHqQkwzF%2BGrD%2BP3Tl9C2k84bY7fNbboifF32PjTFd07b6lMdyPoO23yW8z%2F%2BCPd97bxAhrS0t2FNSs173Uia5Q1pz4mw7VZXdiKC9OY0j7w1gqXBHHgNcU%2FnP0rvn8ByxM7hA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1687,7 +1687,7 @@ Error type: cpp:final_error[]. cpp:final_virtual_ptr[] takes the static type of its argument for its dynamic type, without checking it, unless runtime checks are enabled: -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqlU1FvmzAQ%2FisnKk1EzWDpHqaRplKaIrVaG6Yk68tSIQccchrYCJt0WZT99p2BELTmYdLgAfzdfd%2F5zv72luJKoRTK8uD73sKYvoM%2BWCkTSckSTksrury0CFKyLKIKuMC1iPkaboNgvgiDr%2F70yV%2FcB3ehPx3fPvrh7Nt08fDkh5N7f%2FJlvhQXlIyC%2F3s%2BFzGul4L%2BUERpGXO43midK891V1IqLYvESVBvypWD0pU5FxnXGxnX0Q7gbPL85v9lXBSokaX4izeKS1EqFAkIlnGVs4hDxfG8E2lospQuykjDWGDGUtgvBdCzxUKXtPxdw3YPRkAjYmWqiXQYtrQ7mYDXkg%2BV4pshTh7H87k%2Ft%2Bu0viH1zmbaufzB%2B2A35cNcF9c16abXh63E%2BDwvDJ792ezhzj8nQNVa9rE%2F1wXHcagTo4ZCQ8ZQ2G34NEy7LmhA06oSUua7YQ3UO3sHrO5%2BdIq2RdhKFlrBKx0h8KKQBdBhKLq1XpuCYkuVYohYmoKWQPeQxCLZTNgDpZnGCPQu51TjOMN4Rwd7gmlztaIZgF1phJ0h2PUee6Yb6tmYJZJZjikvKl%2B9EMB%2F8qikG9cY7RinVeM6KzKeu%2Fo4%2BGD4Ka66lrSq22UCW9Ikvxps8PnKOhhtmevGwtZ7peMRGXbwyTp0tvGMClepMe%2BapYp3IkGp81Kf4jQWE2ZFUmZc6ErU6gJvpagkimNetfgr5%2FBC7x%2BvYHrz[Compiler Explorer^] [source,c++] ---- @@ -1763,7 +1763,7 @@ With the default limits, the first three are unlikely with ordinary type ids, and cannot be provoked by a small program. The last two policies take their limits as template arguments, so it takes a registry configured to fail: -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqtU9tu00AQ%2FZXR8pKqaZwEUFU3jVRoJB6AIKXihVTRZr2xR1rvrvZSKJH5dmadmxV4A%2FvB3jNzzlx2Zsu89B6N9iyHb1uGBX1HfWCK6zLyUtKRictLRpA30YkWeIVaqFhImFQhWJ9n2doYH4wrByWGKq4HaDJjpa5lqEyxs3aAQWXtdKn%2FVSazRqFA6bMaNdZcrax0GynCquK%2B%2Bl9BSDogV%2FhT7hW7mj441GULRk9%2FoHktveVCQiuU5yel2%2BRFhCgC3Lf5wnapgZ5ndCHS8dcO7l3AHRRyw6MKRGpuj7QHU0J%2BJDddxVSyLFZOlkjIy044P8gc8Tz%2FTlVPDp3L87%2B1bvKmDzdv%2BzCcTg9R3s3ni8fV%2FMvs86fZ44f5w%2Br9x%2FvFYrbo7ZLpp9T650lctFTUAWqOmsra15tlwNfGBQ8pGZDOGQfUN08Dlx9dhImqAG0CWJUaOobwYiVg4YFvgnRAEVLLh1BThWgVSud37NOdTc5SmvZSUs1Sp4kWpraoiJWG%2F4kA%2BUOKSLOx34aDnU771WAiLcb49WiY%2BArX3b1h7ZUnwzNp0lIlbHQzZk3SNjbs94xd%2BVDc0VaNrlnTSeMrelyrtGEbrrzsWOYx2BhOdrryZOaujLXUoRVlXeBPKQqJ%2BuDXHs58mid6fwPspmpF[Compiler Explorer^] [source,c++] ---- @@ -1772,7 +1772,7 @@ include::example$snippets/errors_hash_search.cpp[tag=classes] include::example$snippets/errors_hash_search.cpp[tag=init,indent=0] ---- -*Example* +*Example* - link:https://godbolt.org/clientstate/eNqtU01v2kAQ%2FSuj7YUoBAM9VN0QpLRB6qEtlYh6KRFa24M9kr1r7UfSNCK%2FvbPGgBWOLT7gfTPvzcx63otw6BwZ7YSEXy%2BCcv6fDEFUShdBFchHkV1eCoacCTZrgXeksyrkCLPS%2B8bJJEmNcd7YYlSQL0M6IpOYBnWNvjT5PtoDRmXTzNf6X2WSxlSUEbqkJk21qjaZeUS7KZUr%2F1cJFvakKvqDnWJf03lLumjB4PgNtKrRNSpDaIWkPCldxywmhMzDbdstvKw18O%2BRrA98fN3Dgwu4gRy3KlSeSbvrI%2B3OFCCP5F1fsR0c843Fghh63ivLg84Rl%2FKJx54dLk7K85ubjefzg%2Fqn5XJ1v1n%2BWHz%2Ftrj%2FsrzbfP56u1otVoN9E8PY0vCs%2BEXLJe2hVqR5nm7QJAGVGusdxCYArTUW%2BMIc75k8pvgSwbF4hc5DSt1sYLYwBf%2FcIFDugBxMYjBK5TiE2lhkptItfQxMN0%2BY70VP33D2ttX5IDa7W%2Bu44JmpG6rQtl54YAB%2FYxZ4WTpzHOJ86pwisuiT6fvJOPIrSvs2Eu0OxADXjB6L2OTjVOyitml8Zztx5Xx%2BwyabfICrOq2JM3rd%2FCRHaRV9t1WVw15kGXwT%2FCnOqxDDyhahRu1bbdEHzqW4MulDXnt4k7N74Ocv7pJyCg%3D%3D[Compiler Explorer^] [source,c++] ---- From d82337000f63134ddeefdd9148f4edc8e9337dcb Mon Sep 17 00:00:00 2001 From: Jean-Louis Leroy Date: Sun, 8 Nov 2026 10:14:34 -0500 Subject: [PATCH 5/6] doc: troubleshooting: show the alternative fix where there is one An error that can be fixed on either side - the overrider or the method, the parameter or the registry - now shows both, the second under an *Alternative fix* label with a sentence saying when to prefer it. Twenty entries have one, among them the pointer kinds, where the method may take a shared_virtual_ptr instead, and not implemented, where an overrider for Cat serves instead of one for Animal. Where the explanation already named the alternative, the clause moves to the sentence that introduces it. The alternatives are fix__2.cpp, compiled as tests like the other fixes; snippets/fix_not_implemented_2.cpp checks that an Animal that is neither a Dog nor a Cat still has no overrider. CLAUDE.md asks for the second fix where an error admits one, and for the Compiler Explorer links to be regenerated when an example changes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr --- CLAUDE.md | 6 +- .../snippets/fix_not_implemented_2.cpp | 59 +++++ .../fix_method_takes_erased_by_value_2.cpp | 28 ++ ...ix_method_takes_virtual_any_by_value_2.cpp | 15 ++ .../fix_minimal_cover_hash_without_bmi2.cpp | 18 ++ .../fix_no_virtual_parameters_2.cpp | 17 ++ .../fix_overrider_discards_const_2.cpp | 18 ++ .../fix_overrider_parameter_type_2.cpp | 20 ++ .../fix_overrider_plain_reference_2.cpp | 17 ++ .../fix_overrider_reference_category_2.cpp | 18 ++ .../fix_overrider_returns_string_2.cpp | 19 ++ .../fix_overrider_smart_virtual_ptr_2.cpp | 20 ++ .../fix_policy_state_move_may_throw_2.cpp | 41 +++ .../fix_policy_state_not_copyable_2.cpp | 38 +++ .../fix_registry_conflicting_affinities_2.cpp | 18 ++ .../fix_registry_conflicting_carriers_2.cpp | 23 ++ .../fix_registry_declared_late_2.cpp | 23 ++ .../fix_registry_mismatch_classes_2.cpp | 20 ++ .../fix_registry_mismatch_parameter_2.cpp | 22 ++ .../fix_shared_ptr_by_reference_2.cpp | 16 ++ .../fix_virtual_ptr_by_reference_2.cpp | 18 ++ doc/modules/ROOT/pages/troubleshooting.adoc | 247 +++++++++++++++--- 22 files changed, 686 insertions(+), 35 deletions(-) create mode 100644 doc/modules/ROOT/examples/snippets/fix_not_implemented_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_method_takes_erased_by_value_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_method_takes_virtual_any_by_value_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_minimal_cover_hash_without_bmi2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_no_virtual_parameters_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_overrider_discards_const_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_overrider_parameter_type_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_overrider_plain_reference_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_overrider_reference_category_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_overrider_returns_string_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_overrider_smart_virtual_ptr_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_policy_state_move_may_throw_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_policy_state_not_copyable_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_affinities_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_carriers_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_declared_late_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_classes_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_parameter_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_shared_ptr_by_reference_2.cpp create mode 100644 doc/modules/ROOT/examples/troubleshooting/fix_virtual_ptr_by_reference_2.cpp diff --git a/CLAUDE.md b/CLAUDE.md index 71e700d7..4d21be42 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -113,7 +113,11 @@ then a `*Fix*` that corrects it. For a compile-time error the two listings are `troubleshooting/compile_fail_.cpp`, with its `expected-error` marker, and `troubleshooting/fix_.cpp`, which `test/CMakeLists.txt` and `test/Jamfile` compile as a test. For a runtime error they are Boost.Test programs, `snippets/errors_.cpp` and -`snippets/fix_.cpp`. Nothing checks that the page lists every message: a removed error leaves +`snippets/fix_.cpp`. Where the error admits a second fix - typically changing the method +instead of the overrider - show it too, as `fix__2.cpp` under an `*Alternative fix*` label +introduced by a sentence saying when to prefer it. After changing an example, run +`dev/ce_troubleshooting.py` to regenerate the Compiler Explorer link next to its `*Example*` +label, and `dev/ce_troubleshooting.py --check` to compile them all on Compiler Explorer. Nothing checks that the page lists every message: a removed error leaves a stale entry, and an added one is simply missing. The tested sources behind the reference's `include:` markers live in diff --git a/doc/modules/ROOT/examples/snippets/fix_not_implemented_2.cpp b/doc/modules/ROOT/examples/snippets/fix_not_implemented_2.cpp new file mode 100644 index 00000000..940414ed --- /dev/null +++ b/doc/modules/ROOT/examples/snippets/fix_not_implemented_2.cpp @@ -0,0 +1,59 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// errors_not_implemented.cpp. + +#include +#include + +#define BOOST_TEST_MODULE openmethod +#include + +#include "error_harness.hpp" + +using namespace boost::openmethod; + +struct Animal { + virtual ~Animal() = default; +}; +struct Dog : Animal {}; +struct Cat : Animal {}; + +// tag::classes[] +BOOST_OPENMETHOD_CLASSES(Animal, Dog, Cat); + +BOOST_OPENMETHOD(poke, (virtual_ptr), void); + +BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr), void) { + // ... +} + +BOOST_OPENMETHOD_OVERRIDE(poke, (virtual_ptr), void) { + // ... +} +// end::classes[] + +BOOST_AUTO_TEST_CASE(overrider_for_cat) { + // An Animal that is neither a Dog nor a Cat still has no overrider. + auto report = initialize().report; + BOOST_TEST(report.not_implemented == 1u); + + capture_cerr cerr; + report_on_cerr(); + auto returned = false; + + reporting([&] { + // tag::use[] + Cat felix; + poke(felix); + // end::use[] + + returned = true; + }); + + BOOST_TEST(returned); + BOOST_TEST(cerr.str().empty()); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_erased_by_value_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_erased_by_value_2.cpp new file mode 100644 index 00000000..b312c895 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_erased_by_value_2.cpp @@ -0,0 +1,28 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_method_takes_erased_by_value.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include +#include +#include +#include + +namespace te = boost::type_erasure; + +using any_node_ref = te::any< + boost::mpl::vector, te::relaxed>, + const te::_self&>; + +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); +// end::content[] + +void call(any_node_ref node) { + postfix(node, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_virtual_any_by_value_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_virtual_any_by_value_2.cpp new file mode 100644 index 00000000..a35c0fba --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_method_takes_virtual_any_by_value_2.cpp @@ -0,0 +1,15 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_method_takes_virtual_any_by_value.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (virtual_std_any&, std::ostream&), void); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_minimal_cover_hash_without_bmi2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_minimal_cover_hash_without_bmi2.cpp new file mode 100644 index 00000000..7419c1be --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_minimal_cover_hash_without_bmi2.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_minimal_cover_hash_without_bmi2.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +struct hashed_registry : + default_registry::with> {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, hashed_registry); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_no_virtual_parameters_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_no_virtual_parameters_2.cpp new file mode 100644 index 00000000..a4385e87 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_no_virtual_parameters_2.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_no_virtual_parameters.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); +// end::content[] + +void call(Plus& plus) { + postfix(plus, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_overrider_discards_const_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_discards_const_2.cpp new file mode 100644 index 00000000..63a5c1a2 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_discards_const_2.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_overrider_discards_const.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (virtual_ptr, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_overrider_parameter_type_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_parameter_type_2.cpp new file mode 100644 index 00000000..271b9324 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_parameter_type_2.cpp @@ -0,0 +1,20 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_overrider_parameter_type.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ofstream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (virtual_ptr, std::ofstream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_overrider_plain_reference_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_plain_reference_2.cpp new file mode 100644 index 00000000..522428af --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_plain_reference_2.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_overrider_plain_reference.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE(postfix, (Plus&, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_overrider_reference_category_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_reference_category_2.cpp new file mode 100644 index 00000000..8e478316 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_reference_category_2.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_overrider_reference_category.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (const virtual_ptr&, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (const virtual_ptr&, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_overrider_returns_string_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_returns_string_2.cpp new file mode 100644 index 00000000..2d79c5e0 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_returns_string_2.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_overrider_returns_string.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(value, (virtual_ptr), std::string); + +BOOST_OPENMETHOD_OVERRIDE(value, (virtual_ptr), std::string) { + return "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_overrider_smart_virtual_ptr_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_smart_virtual_ptr_2.cpp new file mode 100644 index 00000000..0cd51f40 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_overrider_smart_virtual_ptr_2.cpp @@ -0,0 +1,20 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_overrider_smart_virtual_ptr.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD(postfix, (shared_virtual_ptr, std::ostream&), void); + +BOOST_OPENMETHOD_OVERRIDE( + postfix, (shared_virtual_ptr, std::ostream& os), void) { + os << "+"; +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_policy_state_move_may_throw_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_policy_state_move_may_throw_2.cpp new file mode 100644 index 00000000..e3c53bee --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_policy_state_move_may_throw_2.cpp @@ -0,0 +1,41 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_policy_state_move_may_throw.cpp, and compiled as a test. + +#include + +#include "preamble.hpp" + +// tag::content[] +#include + +struct cache_policy { + using category = cache_policy; + + template + struct fn { + struct state { + state() = default; + state(const state&) = default; + auto operator=(const state&) -> state& = default; + auto operator=(state&&) -> state& = default; + }; + + template + static void initialize(const Context&, const std::tuple&) { + } + }; +}; + +struct cached_registry : default_registry::with {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, cached_registry); + +void init() { + initialize(); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_policy_state_not_copyable_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_policy_state_not_copyable_2.cpp new file mode 100644 index 00000000..116bb799 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_policy_state_not_copyable_2.cpp @@ -0,0 +1,38 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_policy_state_not_copyable.cpp, and compiled as a test. + +#include + +#include "preamble.hpp" + +// tag::content[] +#include + +struct cache_policy { + using category = cache_policy; + + template + struct fn { + struct state { + int data = 0; + }; + + template + static void initialize(const Context&, const std::tuple&) { + } + }; +}; + +struct cached_registry : default_registry::with {}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, cached_registry); + +void init() { + initialize(); +} +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_affinities_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_affinities_2.cpp new file mode 100644 index 00000000..3f96209b --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_affinities_2.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_registry_conflicting_affinities.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +BOOST_OPENMETHOD_CLASSES(Node, Plus, Expr, my_registry); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_carriers_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_carriers_2.cpp new file mode 100644 index 00000000..a3302bf7 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_conflicting_carriers_2.cpp @@ -0,0 +1,23 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_registry_conflicting_carriers.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +BOOST_OPENMETHOD( + print, (virtual_, virtual_ptr, std::ostream&), void); +// end::content[] + +void call(Plus& plus, Expr& expr) { + print(plus, expr, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_declared_late_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_declared_late_2.cpp new file mode 100644 index 00000000..e026c785 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_declared_late_2.cpp @@ -0,0 +1,23 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_registry_declared_late.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + virtual_ptr next; + using boost_openmethod_registry = my_registry; +}; + +BOOST_OPENMETHOD(postfix, (virtual_ptr, std::ostream&), void); +// end::content[] + +void call(Expr& expr) { + postfix(expr, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_classes_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_classes_2.cpp new file mode 100644 index 00000000..ba662804 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_classes_2.cpp @@ -0,0 +1,20 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_registry_mismatch_classes.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +struct Sum : Expr {}; + +BOOST_OPENMETHOD_CLASSES(Expr, Sum); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_parameter_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_parameter_2.cpp new file mode 100644 index 00000000..c1c7d7cf --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_registry_mismatch_parameter_2.cpp @@ -0,0 +1,22 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_registry_mismatch_parameter.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +struct Expr { + virtual ~Expr() = default; + using boost_openmethod_registry = my_registry; +}; + +BOOST_OPENMETHOD(postfix, (virtual_, std::ostream&), void); +// end::content[] + +void call(Expr& expr) { + postfix(expr, std::cout); +} diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_shared_ptr_by_reference_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_shared_ptr_by_reference_2.cpp new file mode 100644 index 00000000..8a955b67 --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_shared_ptr_by_reference_2.cpp @@ -0,0 +1,16 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_shared_ptr_by_reference.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +#include + +BOOST_OPENMETHOD( + postfix, (const shared_virtual_ptr&, std::ostream&), void); +// end::content[] diff --git a/doc/modules/ROOT/examples/troubleshooting/fix_virtual_ptr_by_reference_2.cpp b/doc/modules/ROOT/examples/troubleshooting/fix_virtual_ptr_by_reference_2.cpp new file mode 100644 index 00000000..2be404dd --- /dev/null +++ b/doc/modules/ROOT/examples/troubleshooting/fix_virtual_ptr_by_reference_2.cpp @@ -0,0 +1,18 @@ +// Copyright (c) 2017-2026 Jean-Louis Leroy +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) + +// Shown on the troubleshooting page as the alternative fix for +// compile_fail_virtual_ptr_by_reference.cpp, and compiled as a test. + +#include "preamble.hpp" + +// tag::content[] +BOOST_OPENMETHOD(postfix, (const virtual_ptr&, std::ostream&), void); +// end::content[] + +void call(Plus& plus) { + virtual_ptr node(plus); + postfix(node, std::cout); +} diff --git a/doc/modules/ROOT/pages/troubleshooting.adoc b/doc/modules/ROOT/pages/troubleshooting.adoc index f0846d0d..b70bcbe9 100644 --- a/doc/modules/ROOT/pages/troubleshooting.adoc +++ b/doc/modules/ROOT/pages/troubleshooting.adoc @@ -74,9 +74,9 @@ include::example$troubleshooting/compile_fail_no_virtual_parameters.cpp[tag=cont A method dispatches on the parameters declared with `virtual_` or `virtual_ptr`. Without one, it is an ordinary function. -Declare the parameters to dispatch on as virtual. Here, the first parameter is -`virtual_` or `virtual_ptr`. The method then selects an overrider -from the dynamic type of the node. +Declare the parameters to dispatch on as virtual. Here, the first parameter +becomes `virtual_`. The method then selects an overrider from the +dynamic type of the node. *Fix* @@ -85,6 +85,15 @@ from the dynamic type of the node. include::example$troubleshooting/fix_no_virtual_parameters.cpp[tag=content] ---- +Or as a `virtual_ptr`. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_no_virtual_parameters_2.cpp[tag=content] +---- + ''' #### `virtual_traits not specialized for type` @@ -160,6 +169,15 @@ derived class, or a reference to the object. include::example$troubleshooting/fix_virtual_ptr_by_reference.cpp[tag=content] ---- +Or by const reference. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_virtual_ptr_by_reference_2.cpp[tag=content] +---- + ''' #### `virtual_ptr<> takes a class or a smart pointer: virtual_ptr, not virtual_ptr` @@ -284,6 +302,16 @@ The same applies to references and pointers: an overrider for include::example$troubleshooting/fix_overrider_discards_const.cpp[tag=content] ---- +If the overrider is right, and the method is meant to let its overriders +modify the node, drop the `const` from the method instead. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_overrider_discards_const_2.cpp[tag=content] +---- + ''' #### `virtual_ptr<> is required in overrider in same position as in method` @@ -308,6 +336,16 @@ method passes its argument on, cast to that class. include::example$troubleshooting/fix_overrider_plain_reference.cpp[tag=content] ---- +If the overriders are meant to take references, declare the parameter of the +method as `virtual_` instead. The overrider then takes a `Plus&`. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_overrider_plain_reference_2.cpp[tag=content] +---- + ''' #### `different virtual_ptr<> reference categories` @@ -332,6 +370,15 @@ then receives the `virtual_ptr` the way the method passes it. include::example$troubleshooting/fix_overrider_reference_category.cpp[tag=content] ---- +Or by const reference, in both. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_overrider_reference_category_2.cpp[tag=content] +---- + ''' [#overrider_pointer_kind] @@ -358,6 +405,16 @@ holds. include::example$troubleshooting/fix_overrider_smart_virtual_ptr.cpp[tag=content] ---- +If the overrider is meant to share ownership of the node, make the method +take a `shared_virtual_ptr` instead. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_overrider_smart_virtual_ptr_2.cpp[tag=content] +---- + ''' [#overrider_parameter_type] @@ -384,6 +441,16 @@ overrider then receives the argument as the caller passed it. include::example$troubleshooting/fix_overrider_parameter_type.cpp[tag=content] ---- +If the method is meant for file streams only, declare its parameter as +`std::ofstream&` instead. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_overrider_parameter_type_2.cpp[tag=content] +---- + ''' #### `overrider return type is not convertible to method return type` @@ -402,8 +469,7 @@ overrider. Here, the method returns an `int`, and the overrider a Return the type of the method, `int`, from the overrider. The method returns what the overrider returns, so it must be able to convert it to its own return -type. If the overrider is right and the method is wrong, change the return type -of the method instead. +type. *Fix* @@ -412,6 +478,16 @@ of the method instead. include::example$troubleshooting/fix_overrider_returns_string.cpp[tag=content] ---- +If the overrider is right and the method is wrong, change the return type of +the method instead. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_overrider_returns_string_2.cpp[tag=content] +---- + ''' #### `virtual_<> is not allowed in overriders` @@ -775,8 +851,7 @@ include::example$troubleshooting/compile_fail_registry_mismatch_parameter.cpp[ta The class of a virtual parameter declares an affinity for a registry, or the parameter names one, and the method names another. -Name the registry that the class declares on the method, or name none: a -method that names no registry takes the one its parameters carry. +Name the registry that the class declares on the method. *Fix* @@ -785,6 +860,16 @@ method that names no registry takes the one its parameters carry. include::example$troubleshooting/fix_registry_mismatch_parameter.cpp[tag=content] ---- +Or name none: a method that names no registry takes the one its parameters +carry. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_mismatch_parameter_2.cpp[tag=content] +---- + ''' #### `registry mismatch: a class declares an affinity for another registry` @@ -799,8 +884,7 @@ include::example$troubleshooting/compile_fail_registry_mismatch_classes.cpp[tag= A class list names a registry, and one of the classes declares an affinity for another. -List the registry that the classes declare, or none: a list that names no -registry takes the one its classes agree on. +List the registry that the classes declare. *Fix* @@ -809,6 +893,16 @@ registry takes the one its classes agree on. include::example$troubleshooting/fix_registry_mismatch_classes.cpp[tag=content] ---- +Or list none: a list that names no registry takes the one its classes agree +on. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_mismatch_classes_2.cpp[tag=content] +---- + ''' #### `virtual parameters carry conflicting registries` @@ -823,11 +917,9 @@ include::example$troubleshooting/compile_fail_registry_conflicting_carriers.cpp[ The method names no registry, and its virtual parameters belong to different ones: `Node` to the default registry, `Expr` to `my_registry`. -Make the parameters agree: `virtual_ptr`, as below, or -`virtual_`, which adopts the registry of the method because `Node` -declares none. Naming the registry on the method is not enough here: a -`virtual_ptr` always carries a registry, so `virtual_ptr` would then -give <>. +Make the parameters agree: `virtual_ptr`. Naming the +registry on the method is not enough here: a `virtual_ptr` always carries a +registry, so `virtual_ptr` would then give <>. *Fix* @@ -836,6 +928,16 @@ give <>. include::example$troubleshooting/fix_registry_conflicting_carriers.cpp[tag=content] ---- +Or `virtual_`, which adopts the registry of the method because `Node` +declares none. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_conflicting_carriers_2.cpp[tag=content] +---- + ''' #### `the classes carry conflicting registry affinities - list the registry to say which one is meant` @@ -852,9 +954,7 @@ classes that declare one with classes that declare none. Here, `Node` and `Plus` belong to the default registry, and `Expr` to `my_registry`. Register them in separate lists: each list then takes the -registry its classes agree on. When all the classes are meant for the same -registry, add it at the end of the list instead: -`BOOST_OPENMETHOD_CLASSES(Node, Plus, Expr, my_registry)`. +registry its classes agree on. *Fix* @@ -863,6 +963,16 @@ registry, add it at the end of the list instead: include::example$troubleshooting/fix_registry_conflicting_affinities.cpp[tag=content] ---- +When all the classes are meant for the same registry, add it at the end of +the list instead. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_conflicting_affinities_2.cpp[tag=content] +---- + ''' #### `cannot tell which registry this class belongs to...` @@ -925,8 +1035,7 @@ include::example$troubleshooting/compile_fail_registry_declared_late.cpp[tag=con affinity declaration was seen, and kept the default registry. Move the declaration up, to the top of the class, so that it precedes every -use of the class. Alternatively, name the registry where the class is first -used: `virtual_ptr`. +use of the class. *Fix* @@ -935,6 +1044,15 @@ used: `virtual_ptr`. include::example$troubleshooting/fix_registry_declared_late.cpp[tag=content] ---- +Or name the registry where the class is first used. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_registry_declared_late_2.cpp[tag=content] +---- + ### Smart pointers #### `std::shared_ptr cannot be passed by non-const lvalue reference` @@ -960,6 +1078,15 @@ reference. include::example$troubleshooting/fix_shared_ptr_by_reference.cpp[tag=content] ---- +Or by const reference. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_shared_ptr_by_reference_2.cpp[tag=content] +---- + ''' #### `cast only allowed to a shared_ptr` @@ -1078,8 +1205,7 @@ include::example$troubleshooting/compile_fail_method_takes_virtual_any_by_value. A `virtual_any` passed by value would copy the `any`, and its content, on every call. -Pass it by reference: `const virtual_std_any&`, or `virtual_std_any&` if the -overriders modify the content. +Pass it by reference: `const virtual_std_any&`. *Fix* @@ -1088,6 +1214,15 @@ overriders modify the content. include::example$troubleshooting/fix_method_takes_virtual_any_by_value.cpp[tag=content] ---- +Or `virtual_std_any&`, if the overriders modify the content. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_method_takes_virtual_any_by_value_2.cpp[tag=content] +---- + ''' #### `an owning type_erasure::any must be passed by reference` @@ -1101,9 +1236,7 @@ include::example$troubleshooting/compile_fail_method_takes_erased_by_value.cpp[t The same, for a Boost.TypeErasure `any` that owns its value. -Pass it by reference, as a `std::any`: `virtual_`. The -reference forms, `any` and `any`, are handles that -do not own their value, and may be passed by value. +Pass it by reference, as a `std::any`: `virtual_`. *Fix* @@ -1112,6 +1245,16 @@ do not own their value, and may be passed by value. include::example$troubleshooting/fix_method_takes_erased_by_value.cpp[tag=content] ---- +Or dispatch on a reference form, `any` or `any`. +These are handles that do not own their value, and may be passed by value. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_method_takes_erased_by_value_2.cpp[tag=content] +---- + ''' #### `do not wrap a virtual_any in a virtual_ptr...` @@ -1208,8 +1351,7 @@ include::example$troubleshooting/compile_fail_policy_state_not_copyable.cpp[tag= function, and restores it if another policy throws. A `std::unique_ptr` member makes it impossible to copy. -Hold the data in a `std::shared_ptr`, or by value, so that the state can be -copied. +Hold the data in a `std::shared_ptr`, so that the state can be copied. *Fix* @@ -1218,6 +1360,15 @@ copied. include::example$troubleshooting/fix_policy_state_not_copyable.cpp[tag=content] ---- +Or hold the data by value. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_policy_state_not_copyable_2.cpp[tag=content] +---- + ''' #### `+the `state` of a policy that defines `initialize` must be nothrow move-assignable...+` @@ -1232,8 +1383,7 @@ include::example$troubleshooting/compile_fail_policy_state_move_may_throw.cpp[ta The state is restored from a destructor, while an exception is in flight, where throwing would terminate the program. -Declare the move assignment `noexcept`, or let the compiler generate it: a -generated one is `noexcept` when those of the members are. +Declare the move assignment `noexcept`. *Fix* @@ -1242,6 +1392,16 @@ generated one is `noexcept` when those of the members are. include::example$troubleshooting/fix_policy_state_move_may_throw.cpp[tag=content] ---- +Or default the move assignment, and let the compiler generate it: a generated +one is `noexcept` when those of the members are. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_policy_state_move_may_throw_2.cpp[tag=content] +---- + ''' #### `two or more stateful policies in this registry share the same nested state type...` @@ -1310,9 +1470,7 @@ not report the error for x64 builds: it compiles the instruction whatever the flags, so the program requires a processor that supports it. Compile every translation unit with `-mbmi2`, or with a `-march` that implies -it, such as `-march=haswell`. If the program must also run on processors -without BMI2, or on other architectures, use cpp:minimal_perfect_hash[] -instead, which is portable. +it, such as `-march=haswell`. *Fix* @@ -1321,6 +1479,16 @@ instead, which is portable. target_compile_options(my_app PRIVATE -mbmi2) ---- +If the program must also run on processors without BMI2, or on other +architectures, use cpp:minimal_perfect_hash[] instead, which is portable. + +*Alternative fix* + +[source,c++] +---- +include::example$troubleshooting/fix_minimal_cover_hash_without_bmi2.cpp[tag=content] +---- + ### C++26 reflection The examples need a compiler that supports reflection, such as GCC 16 with @@ -1578,9 +1746,8 @@ This is not a mistake by itself: a method may well be meant for some classes only. See <> to find out, at `initialize` time, whether any call can end like this. -Add an overrider for `Cat`, or one for `Animal`. An overrider for `Animal` -serves as a default: it is called for every class that has no more specialized -overrider of its own. +Add an overrider for `Animal`. It serves as a default: it is called for every +class that has no more specialized overrider of its own. *Fix* @@ -1591,6 +1758,18 @@ include::example$snippets/fix_not_implemented.cpp[tag=classes] include::example$snippets/fix_not_implemented.cpp[tag=use,indent=0] ---- +Or add one for `Cat`. It covers `Cat` alone: an `Animal` that is neither a +`Dog` nor a `Cat`, or a class added later, still has no overrider. + +*Alternative fix* + +[source,c++] +---- +include::example$snippets/fix_not_implemented_2.cpp[tag=classes] + +include::example$snippets/fix_not_implemented_2.cpp[tag=use,indent=0] +---- + ''' #### `ambiguous` From e319d6c0d50e37931fac860048c33da8f18b38b7 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leroy Date: Sun, 8 Nov 2026 10:14:47 -0500 Subject: [PATCH 6/6] doc: troubleshooting: stack the source above the output on Compiler Explorer A diagnostic is made of long lines, which a pane beside the source cuts short. The links now carry a layout rather than a session: the editor above the execution pane, which takes the whole width of the window. A session cannot say how its panes are arranged, and Compiler Explorer puts them side by side. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr --- dev/ce_troubleshooting.py | 49 ++++---- doc/modules/ROOT/pages/troubleshooting.adoc | 120 ++++++++++---------- 2 files changed, 83 insertions(+), 86 deletions(-) diff --git a/dev/ce_troubleshooting.py b/dev/ce_troubleshooting.py index 9cfbc996..70421048 100644 --- a/dev/ce_troubleshooting.py +++ b/dev/ce_troubleshooting.py @@ -7,7 +7,7 @@ """Link every example of the troubleshooting page to Compiler Explorer. Each `*Example*` label of `doc/modules/ROOT/pages/troubleshooting.adoc` gets a -link that opens the example on Compiler Explorer, with the source and the +link that opens the example on Compiler Explorer, with the source above the output of the compiler - and of the program, for an error reported at run time - and no assembly. Run it from the root of the repository whenever an example changes; it rewrites the links in place: @@ -38,7 +38,7 @@ import urllib.request from pathlib import Path -from ce_link import BOOST, COMPILER, clientstate_url +from ce_link import BOOST, COMPILER, clientstate_url, component, editor PAGE = Path("doc/modules/ROOT/pages/troubleshooting.adoc") EXAMPLES = Path("doc/modules/ROOT/examples") @@ -172,30 +172,27 @@ def compiler_for(source, path): return COMPILER, OPTIONS -def session_state(source, compiler, options): +def layout_state(source, compiler, options): + # A layout rather than a session, which would put the panes side by side: + # the source above the output, so that the long lines of a diagnostic get + # the whole width of the window. + executor = component( + "executor", + source=1, + lang="c++", + compiler=compiler, + libs=[{"name": "boost", "ver": BOOST}], + options=options, + compilationPanelShown=False, + compilerOutShown=True, + argsPanelShown=False, + stdinPanelShown=False, + wrap=False, + ) + return { - "sessions": [ - { - "id": 1, - "language": "c++", - "source": source, - "compilers": [], - "executors": [ - { - "compiler": { - "id": compiler, - "libs": [{"id": "boost", "version": BOOST}], - "options": options, - }, - "compilerVisible": False, - "compilerOutputVisible": True, - "arguments": "", - "argumentsVisible": False, - "stdin": "", - "stdinVisible": False, - } - ], - } + "content": [ + {"type": "column", "content": [editor(1, source), executor]}, ] } @@ -338,7 +335,7 @@ def main(): source = source_for(path, tags) compiler, options = compiler_for(source, path) - url = clientstate_url(session_state(source, compiler, options)) + url = clientstate_url(layout_state(source, compiler, options)) page_lines[i] = f"*Example* - link:{url}[Compiler Explorer^]" if not args.print: diff --git a/doc/modules/ROOT/pages/troubleshooting.adoc b/doc/modules/ROOT/pages/troubleshooting.adoc index b70bcbe9..a25f70ce 100644 --- a/doc/modules/ROOT/pages/troubleshooting.adoc +++ b/doc/modules/ROOT/pages/troubleshooting.adoc @@ -64,7 +64,7 @@ include::example$troubleshooting/preamble.hpp[tag=content] #### `method has no virtual parameters` -*Example* - link:https://godbolt.org/clientstate/eNplUlFr2zAQ%2FitCg%2BCQNFm6hzK1zUNpYC%2BrAyt7aUpQ5It9VJaEJWUtwfvtO7nO4q0O2Lnvu%2B87ne6O3IP3aI3ngj0dORb0XUwZ19KUUZZAIVeTCSfI29ioDviERulYALtB60MDsl5uzMac4SoE58V8vrPE26aclRiquJuhnVsHpoZQ2eKdHQCzyrnOKHo0JTOyBu%2BkAtYlCnHOvE5ZVDmqwB4sVTxuDKPngE2IUrPfCczG7JYVsJdRBxK0Q9FaR89Er%2F2Hqd%2B2DZRI0Rsl9PK%2FkBC%2FqJMbZzUqBC9EE03AGraqAvXilyezuzz%2F8bjN16uH76vHb%2Fl95qiDPb5OWZZqjqbMh4I6er%2B90XjKDhaLcadN%2F5iSWmfplCPm6D0%2Bddj7ZAnsTZSNISnbjUljUrZ2qKHpJvpMALyCijSFfsQnnqJ%2B3lylaV9%2BWXxOeo274TLw7vITcSBP2pSELb5e8jZ5Wxf65eEXdJhbWpXFFW8Hx%2FiJHnc6rc1eag8DJo%2FBxXDm6f4TLZsy1mBCZ8qHwEcrKonmlNcF%2F%2BW0z%2FT7AyJ%2F%2FYE%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUt1r2zAQ%2F1eEB8GhbrJ0D2Pux8NYYC%2BLA%2BnbUoIiK%2FYxWRLSKWkI3t%2B%2Bk%2BM0KaQwG2zd70s%2B6w6JMBqlxiRnvw8J7q2kFYEqNDrJ2Ed0Y42OcHZRzHjTs6WcloDGvaMXyDHyhwRKek2IU1xXnePmJkq9CU50EZ9ACxVKyR7AeHSSN09LvdRnuEa0Ph%2BP14Z446pRBViH9QjM2FipG4m1KY%2FsBTCqre2CggddMU0f7C0XknXCPD8r76OKdg4C2Yz6YYelZnRtwWHgiv2NYDpkj6yUGx4UkqG9NM1V8Czvve%2BYZr9ysgKq9iTo7W9Qnu%2BokwdrFAiQPs9d0AiNXIlaij%2F%2B6RT2vSgWz6tiPp39mj7%2FLH6kljrYwGvG0rjnIGMeS%2Bro%2BPcGw4xtDZTDzhtXTHCl0viVA2bpOTx12OekEexDhAkYne1SJ22bsf8dBPkqRfh4DN6O%2B8ooRDko6ToocndfJp8joWDtj8Oo%2B126s4vU9iiffLtL2heqjUUwOqqTW%2BrjkaInX8%2FhPLJzrqVa1GanSbbhysuLzYuAJ4qOLjLcVf6qhfLhetjOcXsq2%2FaF7n8h9C0%2B[Compiler Explorer^] [source,c++] ---- @@ -98,7 +98,7 @@ include::example$troubleshooting/fix_no_virtual_parameters_2.cpp[tag=content] #### `virtual_traits not specialized for type` -*Example* - link:https://godbolt.org/clientstate/eNplUsFO4zAQ%2FRXLK6FUdFvKHlaY0gMCiQsEaRGXLapcZ5qM1rGt2C6gKvvtjENKAyRSknlv5o0nb3bcg%2FdojeeC%2Fd1xLOg9GzOupSmjLIFCro6POUHexkZ1wA80SscC2BytDw3IerE0S3OAqxCcF9Pp2hJvm3JSYqjieoJ2ah2YGkJli3d2AEwq5zqh6NGUzMgavJMKWJcoxCHzPGVR56gCu7PUcbc0jK4tNiFKzf4nMBuxC1bARkYdqKAdFt3r6Jnoaz8x9euqgRIpeqWEvvwDEuKZJpk7q1EheCGaaALWsFIVqH9%2BsRe7zPM%2FD6v8%2Fvru9vrhJr%2FKHE2wwZcxy%2Fozruap%2BWLMfChotPffeDQas63FYtSJpC%2BmpNZZOu4Rc%2FQc7UftBbME9iLKxpAq26VJfilbO9TQdNY%2BEQAvoCLZ0Xu95ynqjecq2X76a3aS6jWuh1vBOxcSsSVNWpmEzc5OeZu0rQv9FvGfdJgL2pnZb94OjvGIHtc67c9Gag8DJo%2FBxXDgyYhEy6aMNZjQifIh8F2KWqLZ53XBl5z2ie43RO4BSg%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUsGO2jAQ%2FRUrlVZBm0LZHqqmLIeqSL2UILG3skLGMYlVZ2zZY1iE0m%2FvOISFlVipiRR73nvzxhPPMREGUAImOft9TPBgJe0I1KGBJGPv0Y01EOHsKpjzpmdLOSsVGveGXiLHyB8TVdIyJk5zqLqM%2B%2Fso9SY40Vl8UCB0KCWbKOPRSd5MV7CCC1wjWp%2BPRhtDvHHVsFJYh81QmZGxEhqJtSlP7BUwrK3tjIJXUDGgA3vLhWSdMM8vym9RRZWDQDanfthxBYyenXIYuGZ%2FI5gO2CMr5ZYHjZTQXictdPAs73PfMM1h7WSlKDqQoE9%2FhfJ8T51MrNFKKOnz3AVA1ci1qKX446dns%2B9FsXxaF4vZ%2FNfs6WfxI7XUwVa9ZCztz7iexOLTjHksqbXTb7wbZGxnVDnoTOKOCa51Go97xyx9B%2BdWe8M0gr2JMAFjZruCpG0z9r8TIV%2BkCO%2FPw%2Bu935iJKFdaug6K3MPn8adIaLXxp6mEvkp3iZHaneTjrw9J%2B0yxsagMRHXykfp4JOvxl4s5j%2ByCg9TL2uyBZFuuvbwqXgQ8U3SHkeGu8jdTyF%2FdNts7bs9h2z7T%2Bw8QCDD4[Compiler Explorer^] [source,c++] ---- @@ -122,7 +122,7 @@ include::example$troubleshooting/fix_virtual_by_value.cpp[tag=content] #### `virtual_<> parameter is not a polymorphic class...` -*Example* - link:https://godbolt.org/clientstate/eNplUlFv0zAQ%2FiuWkaZUKy0dD2im6wNiEg%2BwTGLihU6V61yTE45txXbZVIXfzjl11zDih%2Fi%2B7%2B7z2fcduAfv0RrPBft54FjRfzFlXEtTR1kDhVxdXnKCvI2dGoA3aJSOFbAlWh86kO1qbdbmDDchOC%2Fm860l3nb1rMbQxO0M7dw6MC2ExlZHdgTMGucGoejR1MzIFryTCtiQKMQ582PKopOjCuzO0omHtWH07bELUWr2J4HFhN2wCnYy6kAF%2FbjoXkfPRK79h2mfNx3USNEzJeTyF0iI33STpbMaFYIXoosmYAsb1YD65VevxL5igI76yeinsvz%2BsCnvb%2B%2B%2B3T58KT8Xju61w6cpK3Lnm2UuuVhNmQ8VXfr4wBeTKdtbrCaDUNoxJbUuTulMHzeT01Nk6SLjWU3ZGJJEvzZppMq2DjV0w%2FQfCYAnUJEmlu1w4inK3uAqOePq%2FeJdqte4HRuHD4NKxJ40yVUJW1xf8T5pWxey0fhbauaGbLX4wPtRGz%2FQ41Yni%2B2k9jBiyhhcDGeenjfRsqtjCyYMonwM%2FC9FR6I55Q3Bq5z%2BkdZfS2EOqw%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUk9v2jAU%2FypWJlVBzWB0h2kZ5TANaYeNINHbqJBxTGLNsS37GYpQ9tn3nJhCKyo1OcTv989%2BzjsmTCvgCpKc%2FDkmcDAcVwhK36gkI2%2FRjdEqwNlFMadNZEs%2BKwVo%2B4JeAoXAHxNR4meMnKSq6hy3t0HqtLesi%2FggFJO%2B5GQitAPLaTNdqZU6wzWAcflotNHIa1sNKwG13wyFHmnDVcOh1mXPXgDD2pguyDuhKqLwwM5QxkknzPOz8ltQ4c6eAZljP%2BS4UgSfnbDgqST%2FApgOyD0p%2BZZ6CWhoL00L6R3Jo%2FcF0xzWllcCqwMKov0ZyvM9djIxWgomuMtz6xWIhq9ZzdlfN30V9ksAt3ieiH4viuXDuljM5r9nDz%2BLH6nBvrbiKSNpPPl6Ei0304w4KLHp%2FoJvBhnZaVEOuqCwIoxKmZ7kRPaLwekqYnQa8ZjGtIcQ0a5U0rYZee%2FQ8CfO%2FNsj8zwaV8YmyIXktoMCd%2Fd5%2FCkQUmxcP7gq7tL950Dtevn4613SPmKtDQitgjr5iH3cY%2FT4yzmcBnZBFZfLWu8VyrZUOn6xeeHhROGfCQy1lbtqwXxxPWxvqTmVbfuI73%2FerD5Z[Compiler Explorer^] [source,c++] ---- @@ -147,7 +147,7 @@ include::example$troubleshooting/fix_virtual_non_polymorphic.cpp[tag=content] #### `virtual_ptr<> must be passed by value or by const reference` -*Example* - link:https://godbolt.org/clientstate/eNplUl1v0zAU%2FSuWkapUKy0dD4is6wNiEi8sk5h4oVPlOrfJFY5t%2BaNsqsJv59pNaRiJlMTnnPuVe47cg%2FdotOcl%2B3HkWNN7OWNcCd1E0QAduby64gR5E53MwBvUUsUa2AqNDw5Et97ojb7AbQjWl4vFzhBvXDNvMLRxN0ezMBZ0B6E19YkdAfPW2pwoetQN06IDb4UEloVleVHeJBVVjjKwe0MVjxvN6DqgC1Eo9juBxZTdshr2IqpAAf046EFFz8oh9h%2Bme9k6aJBOLyQYwv9CZfmLJllZo1Ai%2BLJ0UQfsYCtbkD%2F9%2BpzsU1V9e9xWD3f3X%2B8ev1SfC0sT7PF5xoqhx60NbpXqrycz5kNN451%2B5WQ6YweD9TQnSl9MCqWK1PKEWXpOX417ScV0mjtrbk6SoW6RiKGONDEkut%2FotFZpOosKXHbAEwHwDDLS1gZLnHk6Df7gMrnj%2Bv3yXYpXuBubh%2BdlJeJAOclZCVt%2BvOZ9ym1sGMzG31Izt2St5Qfej9r4jh53KtlsL5SHEVPFYGO48LSvRAvXxA50yEn5GPg%2FFZVEfdblwytN%2F0T3H5z%2BDsQ%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNklFv2jAQx7%2BKlUkoqBmM7mGaS3mYhrSXEST6NipkHJNYc2zLPkMRyj77zkkodKLSEimJ7%2Fe%2F%2F%2FniOyXcaBAaEkp%2BnRI4WoFfGFSh1klG3sO1NTqGs6vFgtU9LcS8kGDcG7wCBpGfElnga4JMMV22GXd3UepNcLy1%2BCA1V6EQZCqNBydYPVvrtb6EKwDr6Xi8NciNK0elhCpsR9KMjRW6FlCZoqNXgVFlbWsUvNQl0bhhbxkXpBVSelE%2BRBVWDhzIAvshp7UmeO2lg8AU%2BROD6ZA8kkLsWFCACc110lIFT2if%2B4bUx40TpcTVEQV9%2BmuI0gN2MrVGSS6Fp9QFDbIWG14J%2FtvPzmbf8nz1tMmX88XP%2BdOP%2FHtqsYOdfMlI2u9xY8FNY%2F3ZICMeCmyv%2B5WDYUb2RhbD1ih%2BEc6USuOWB8Tic%2FhPuxcromPfreahk%2FR10wj6OtwEiLhZ66RpMvK%2FgyNeBA%2Fvj83reNwYnSiXSrg2FNn958mnCJTc%2Bm54dV%2BlPeuI9p188vU%2BaZ5xbSxIo6M6%2BYh9PKL15MvFnEW6ZFqoVWUOGmU7pry4Kp4HOCM86kiYK%2F3NFPSXt80Ojtnzsmme8f4LtOI%2Bcg%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -182,7 +182,7 @@ include::example$troubleshooting/fix_virtual_ptr_by_reference_2.cpp[tag=content] #### `virtual_ptr<> takes a class or a smart pointer: virtual_ptr, not virtual_ptr` -*Example* - link:https://godbolt.org/clientstate/eNplUl1v2zAM%2FCuCBgzOmiZL91BMS%2FMwrMBeVhdYsZelCBSZsYnKkqCPrEXg%2FfZRrtN4rQ3Y5h15FH088AAhoDWBC%2Fb7wLGi92LKuJamTrIGCrk6O%2BMEBZu86oF3aJROFbAl2hA9yHa1NmtzgpsYXRDz%2BdYSb309qzE2aTtDO7cOTAuxsdUzOwJmjXO9UApoamZkC8FJBaxPFOKU%2BSVnUeekIrux1PGwNoyuPfqYpGZ%2FM1hM2BWrYCeTjlTQjYtudQpMDLX%2FMe3TxkONFD1RwlD%2BAgnxhyZZOqtRIQQhfDIRW9ioBtRDWB3Fvpblz7tNeXt98%2BP67nv5rXA0wQ4fp6wYzrhx0S9z%2Fw%2BrKQuxovGef%2BX7yZTtLVaTXih%2FMefRxKJPZoaek%2BO8g2qRwUFF2RRzabc22TRlW4cafO%2FvPQHwCCqRJ4PhR56iwX2usvcXnxYfc73G7Xg1eG9FJvakSXuTscXnC95lbevisEr8nA5zRYuzuOTd6Bi%2FMOBW5yXaSR1gxJQpuhRPPLmRaenr1IKJvSgfA2%2BlqCWaY14fvMrp7un%2BB4ITAwU%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUsGO2jAQ%2FRUrlarQTaFsD1VTlkNVpF5KkNhbWSHjmMSqM7bsMSxC6bd3HMLCSqzURIo9771544nnmAgDKAGTnP0%2BJniwknYE6tBAkrG36MYaiHB2Fcx507OlnJUKjXtFL5Fj5I%2BJKmkZE6c5VF3G3V2UehOc6CzeKRA6lJJNlPHoJG%2BmK1jBBa4Rrc9Ho40h3rhqWCmsw2aozMhYCY3E2pQn9goY1tZ2RsErqBjQgb3lQrJOmOcX5beoospBIJtTP%2By4AkbPTjkMXLO%2FEUwH7IGVcsuDRkpor5MWOniW97mvmOawdrJSFB1I0Ke%2FQHm%2Bp04m1mgllPR57gKgauRa1FL88dOz2feiWD6ui8Vs%2Fmv2%2BLP4kVrqYKueM5b2Z1xbdJNY%2F8M0Yx5Lau%2F0K98PMrYzqhx0RnHHrFOAaSdmQN%2FBud%2FeNY1g7yJMwJjariBp24z971jIZynC20Pxcvk3BiPKlZaugyJ3%2F3n8KRJabfxpNKGv0t1kpHYn%2BfjrfdI%2BUWwsKgNRnXykPh7IevzlYs4ju%2BAg9bI2eyDZlmsvr4oXAc8UXWRkuKv8zRTyV7fN9o7bc9i2T%2FT%2BAzzlMrM%3D[Compiler Explorer^] [source,c++] ---- @@ -208,7 +208,7 @@ include::example$troubleshooting/fix_virtual_ptr_of_raw_pointer.cpp[tag=content] [#override_not_found] #### `BOOST_OPENMETHOD_OVERRIDE: cannot find '...' method that accepts the same arguments as the overrider` -*Example* - link:https://godbolt.org/clientstate/eNptUsFu2zAM%2FRVBA4YETZOlOwzz3ByGBtgOrYuu6GUuDEVWbGKyJJhS1iLIvn2UYy9eW%2Btg8D3ykaLenqNCBGuQJ%2BznnkNJ%2F%2BWMcS1MFUSlKOTy7IwThDa0sgPegZE6lIqlYNG3SjSr3OTmBNfeO0wWi40l3rbVvAJfh80c7MI6ZRrla1se2REwr53rhAKCqZgRjUInpGJdYpKcMr%2FELOocpGc3ljruc8Po20Hrg9DsTwQnU3bJSrUVQXsqOIyLbnVAlvS1%2FzHNc9GqCih6poS%2B%2FB%2BUJL%2FpJqmzGiQoTJI2GA%2BNKmSt5C9cDWJSC0R2DeZVm69Z9uO%2ByG7XN9fr%2B2%2FZ1cTR3bbwNGOTfvrC%2BTaNJasZQ1%2FSvY87fj%2BdsZ2FcvqmTpE9rO%2Fuvl%2BtJ8dVvC3bTfRSl1kcpIdFWmRpynJ%2BnvO4utxEA0jbONCq7bzySIB6UjLQ%2B%2FbmGXiKeidxGX108XH5IdZr2IxtxrtnjcSONMmDEVt%2BvuCHqG2d723Jz2naSzLh8hM%2FjMZ4AISNjobcCo1qxGTBu%2BBPPL1spEVbhUYZ34nyMfBailqCGfK64EXO4ZHOXxRZGoI%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUltr2zAU%2FivCg5FQN1m6hzHPzcOoYXtoHJqyl7kYRVZsMVkSuiQNwfvtO%2FKlSTcXZj%2FY53yXc%2BGcAiKFpcIGEfp5CuxRUfiDJHe1CEL0FlwrKXw6vAhWuO7RgiYFs1K%2FgjcWW4%2BfAlbAZwEYx6JsFVdXnmqk06S1eMcE4a6gKGbSWE1xvcxEJs7pylplovl8KwGXupyVzFZuO2NyLhUVNbWVLDr0IjGrlGqNnGGiRAIaNgoTilpiFJ2ZXzwLKjti0QrmQadMIHj2TFuHOfrtk5MpukUF3WHHLQiaS9GaO4OiXvsKqY%2B5piWD6AiEXv6SiqIDTBIryRlh1ESRdsKymuakouSXWQ5mhGNj0D0T%2F5T5mqabxzxdJ6v75PFbejdRMNuOPYdo0nefK6tjL1mGyNgC5u52%2FH4aor1kxXTUJ09%2FJA8P3%2B%2BSSbeKcdu2o799kTSD9bBIaVAcoyy4zgK%2FukwETROi%2Fz0x%2BkyJe%2FvAXg5p5Mg8nXGq25THbj4uPniAs63pzlz0Vdqr8NC%2Boy8%2B3wTNE8RSWSaFZwfXMOgtWC8%2Bnc2xR9dYUL6p5EEAbYe5oRfFU2cHCI7CI1iXZlQC%2Fmzc7KCxGsKmeYL3D4lISjA%3D[Compiler Explorer^] [source,c++] ---- @@ -276,7 +276,7 @@ include::example$troubleshooting/fix_override_private_base.cpp[tag=content] [#overrider_discards_const] #### `overrider parameter discards const qualifier` -*Example* - link:https://godbolt.org/clientstate/eNptUk1v2zAM%2FSuCBgwJkiVLdximuTkMDbAdVhdd0ctcGIqs2MRkSdBH1iJIf%2Fsox168rtbB4Hvkk0i%2BA%2FXSezDaU0Z%2BHihU%2BF%2FNCVVc15HXEkMqZjOKkDfRiQ54A1qoWEmSgfHBSd6uC13oM9yEYD1bLrcGeePqRQ2hidsFmKWxUrcyNKY6sSNg0VjbCUUPuiaat9JbLiTpEhk7Z35OWXhzFIFcG7zxUGiC3x5ciFyR5wROpuSSVHLHowpYcBwX3ajoCetr%2F2Hap9LJGjB6woS%2B%2FC%2FE2G%2FsJLNGgQDpGXNRB2hlKRopfvn1IPYlz3%2FclfnN5vr75u5rfjWx2MEOHudk0r%2BxtMFlAgd%2F6mA9Jz5U2ONpnm%2Bnc7I3UE1fVSvz%2B83t7berzeTU9uviqceXssT4QXmYmfEky0hBZwVNUyp02rUwrQUlXWeLBwTkoxQRV9n7ZOAx6k1DRbLMxYfV%2B1SvYDt2FO02mIg9aqLdErb6dEGPSdvY0DuQvsPXXqLfVh%2FpcfSMe%2FCwVcl7O668HDF5DDaGM49LTDR3dWylDp0oHQP%2FS%2BGVoIe8LniRc3zA8wdH7xM2[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUl1r2zAU%2FSvCg5EQL1m6hzHPzcOoYXtYHJqyl7kYRVZsMVkS%2Bkgagvvbd%2BWPJh0uzH6w7znnHulI9xwQKSwVNojQ73NgT4rCH4Dc1SII0Vt0raTwcHhVrHHdswVNCmalfkVvLbaePwesgM8SOI5F2XbMZl5qpNOktXjHBOGuoChm0lhNcb3KRCYucGWtMtFisZPAS13OS2Yrt5szuZCKipraShYdewXMK6VaI2eYKJGADRuFCUWtMIouyq9eBSs7YtEa8qBzJhA8B6atwxw9e3AyRbeooHvsuIWG5rppw51BUd%2F7iqlPuaYlg%2BoEgr79BYqiIySJleSMMGqiSDthWU1zUlHyx6wGs29pun3I002y%2Fpk8fE%2FvJgoS7NlTiCb9HnNldQzXZ7oEqxAZW0DG7jzfT0N0kKyYjrrl6a%2Fk%2Fv7HXTLpYo%2Bb%2B4z%2F2iJpBufhzKRBcYyyYJYF%2FpQyETRNiP53mugTJe7tWXqZmZF58nLGqW4hz918Wn70BGc700206FdpB8BTh06%2B%2FHITNI9QS2UZnKHHPkDQW7Befr6YY89usKB8W8mjANkec0OvFk%2BdHSi4f89gXZrRFvBn42ZHjdVQNs0jvH8BzLtC5A%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -316,7 +316,7 @@ include::example$troubleshooting/fix_overrider_discards_const_2.cpp[tag=content] #### `virtual_ptr<> is required in overrider in same position as in method` -*Example* - link:https://godbolt.org/clientstate/eNptUk1v2zAM%2FSuCBhQJkiVLdximuTkMDbAdVhdd0UtdGIqs2MRkSdBH1iJIf%2Fso1268btbB4Hvkoyi%2BA%2FXSezDaU0buDxQq%2FK%2FmhCqu68hriSEVsxlFyJvoRAe8Ay1UrCTJwPjgJG%2FXhS70CW5CsJ4tl1uDvHH1oobQxO0CzNJYqVsZGlO9sCNg0VjbCUUPuiaat9JbLiTpEhk7ZX5JWdg5ikCuDHY8FJrgtwcXIlfkOYGTKbkgldzxqAIWHMdF1yp6wvrav5j2qXSyBoyeMKEvf4UY%2B42TZNYoECA9Yy7qAK0sRSPFL78exL7m%2Bc%2FbMr%2FeXP3Y3H7LLycWJ9jB45xM%2BjuWNrgs9V%2FPiQ8VTvfykmfTOdkbqKb%2F1Snzu83NzffLzUgwzXL2RoQYP%2BgMb2M8yTJS0FlB02sUOu1UmNaCkq5b%2FwMC8lGKiCvr%2FTDwGPXmoCJZ4%2Fzj6kOqV7AdO4d2m0rEHjXRVglbfT6nx6RtbOidRt%2FjbS%2FQV6tP9Di6xh142KrksR1XXo6YPAYbw4nHZSWauzq2UodOlI6Bf6WwJeghrwve5Bwf8PwBiSAKlQ%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUl1vmzAU%2FSuWJ1WJwpKle6jGaB6mIq0PDVFT9WVUyAEHrBnb8kfSKGK%2FfdcEGjql0uAB7jnnnut7fY84l8JSYXGIfh2xPSgKfwByVwscoI%2FoWknh4WAQLEndsQWNC2alfkevLbGeP2JWwGcOHCeibDMmEy810um8tfjERM5dQVHEpLGaknqRilSc4cpaZcLZbCOBl7qclsxWbjNlciYVFTW1lSxO7ACYVkq1Rs4wUSIBBzaK5BS1wjA8K797FVR2uUVL6AcdU4Hg2TFtHeHojwdHY3SLCroljltIaIZJK%2B4MCrvcd0x9yDQtGUQHEHTpb1AY7qGTSEnOckZNGGonLKtpllc0%2F20WvdmPJFk%2FZckqXj7ETz%2BTu5GCDrbsNUCj7oyZsjry9RcBMraA7k6TvBoHaCdZMb7okyXP8ePj%2FV08MPS9XP1jgqTpffrZSIOiCKV4kmI%2FjVTgpgnQ%2F24NfaW5%2B3hn3nbjwt54OeNUt5Dnrr%2FOv3iCs405ba7oqrQX7andST7%2Fdo2bF4ilskwKr8afodFbsJ7fnM2JZ1dEUL6u5F6AbEu4oYPiibM9BffsGaJLczEF%2FNlls70mqg%2Bb5gXev4B6OkM%3D[Compiler Explorer^] [source,c++] ---- @@ -350,7 +350,7 @@ include::example$troubleshooting/fix_overrider_plain_reference_2.cpp[tag=content #### `different virtual_ptr<> reference categories` -*Example* - link:https://godbolt.org/clientstate/eNptUk1v2zAM%2FSuCBhQJkiVLdximuTkMDbAdVhdd0ctcGIqs2MRkSdBH1iJIf%2Fsox168btbB4Hvkoyi%2BA%2FXSezDaU0Z%2BHChU%2BF%2FNCVVc15HXEkMqZjOKkDfRiQ54A1qoWEmSgfHBSd6uC13oM9yEYD1bLrcGeePqRQ2hidsFmKWxUrcyNKY6sSNg0VjbCUUPuiaat9JbLiTpEhk7Z35KWdg5ikBuDHY8FJrgtwcXIlfkJYGTKbkildzxqAIWHMdFtyp6wvrav5j2uXSyBoyeMaEv%2FwMx9gsnyaxRIEB6xlzUAVpZikaKn349iH3O8%2B%2F3ZX67ufm2uf%2BSX08sTrCDpzmZ9HcsbXBZ6r%2BeEx8qnO70khfTOdkbqKb%2F1Snzh83d3dfrzeQ08FlW4A4DGYunGdcXr9SJ8UOD4dGMJ1lGCjoraHqmQqdlC9NaUNJ1vnhEQD5JEXGXvVEGHqPeNVQkz1y%2BX71L9Qq2Y0vRboWJ2KMm%2Bi1hq4%2BX9Ji0jQ29BelbvO0VGm71gR5H13gAD1uVzLfjyssRk8dgYzjzuMVEc1fHVurQidIx8K8UtgQ95HXBq5zjI57fBmITXA%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUl2L2zAQ%2FCvChSMhbtJcH0pdXx7KBdqHxuFy9KU%2BgmIrtqgsCWmVXAjub%2B%2FKHxdfyUHtB3t3Zmc1Ys5BpiQwCUFEfp0DOGmGf9gUrpJBSN6CK62kb4eDYkWrDs3ZMuegzCt4AxQ8fg54jp85YoLKopmYTDzVKmeyRuIdl5lwOSMxVxYMo9Uilam8tEsAbaPZbKcQV6aYFhxKt5tyNVOayYpBqfIWHTSmpdaNkLNcFkTiga2mGSMNMYouzC%2BehZtdBmSFfsg5lQSfAzfgqCB%2FfHM0JnckZ3vqBOBAPRxaC2dJ1M2%2BQqrT1rCCY3VCQjf%2B0oqiIzqJtRI848xGkXESeMW2Wcmy33bRi31Nks3jNlkvVz%2BWj9%2BS%2B5FGB3v%2BHJJRd8atBhP7%2FYuQWMjRXXuTN%2BOQHBTPx1d1tsnP5cPD9%2FvlqDV8kcUkWCBDce9xcfOPOlG2X9BfmrIkjkkaTNLAX1Mqg7oOyf%2FGiT2zzL0dppfQXAmUp3PBTNPy2O3H%2BQcPCL6zbaRlt6VJgIcOLX3%2B%2BTaon7BWGjg69733aPQOpeefLuLUo2sqmdiU6iiRtqfCssHyxEEPYQA8Qk1hr46gPr8udjRU92VdP%2BH7F7IFQwo%3D[Compiler Explorer^] [source,c++] ---- @@ -384,7 +384,7 @@ include::example$troubleshooting/fix_overrider_reference_category_2.cpp[tag=cont [#overrider_pointer_kind] #### `different virtual_ptr<> pointer kinds` -*Example* - link:https://godbolt.org/clientstate/eNqlUstu2zAQ%2FBWCBQobdq06PRRVFB%2BKGGgPjYI0yCUKBJqipUUpkuDDTWA4396lLMVK2lulg7Azu7PUcPbUCedAK0dTcr%2BnUOF3OSdUMlUHVgssKZ%2FNKEJOB8s74B0oLkMlSAbaeStYuypUoU5w471xaZJsNPLa1osafBM2C9CJNkK1wje6OrIjYNEY0wkFB6omirXCGcYF6RrT9NR5Hrtwc%2BCeXGncuC8UwWcH1gcmyXMEJ1NyQSqxZUF6HDiMh65lcCTtZ18x7VNpRQ1YPWFDP%2F4Cpelv%2FJPMaAkchEtTG5SHVpS8EfyXWw1i%2F2tFAsoLq03ifFW6hllRlcbbF4e%2B5vnP2zK%2FXl%2F9WN9%2Byy8nBue38Dgnk96D2J7F%2F1vNCYqge8ebej%2Bdk52Ganr%2BL50yv1vf3Hy%2FXE%2BOhp5k%2B0OM1aOJb9WJdsOC4VK0I1lGCjoraLyGQsUwcd0akMJ2uXtAQDwKHtCgPogDj1WfSspjJs8%2BLT%2FGeQmbcWRpZ2AkdqiJeY7Y8ssZPURtbXwfcfoBT3uBgV5%2BpofRMe7AwUbGcG%2BZdGLE5MGb4E88piTSzNahFcp3onQM%2FC2FK0ENfV3xpufwgO8fdqY4sA%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU9uK2zAQ%2FRXhQkmIGzfbh1KvNw9lDe1D47BZ%2BlIvRrEVW1SWhC7JhuD99o58SbwlC4XaD%2FbMOXNGc9HJywU3hBsvRL9OnjlKAn%2FgZLbmno%2FegmspuHP7I2OF6x4tSFxQI9QreGOwcfjJowV8FoAxzMs2YjZzVC2syluJd5TnzBYERVRoowiulylP%2BcVdGSN1GARbAbhQ5bykprLbORWBkITXxFSi6NCRY15J2QpZTXmJOBxYS5wT1BLD8MK8dSzIbHODVlAPOqUcwbOnyljM0ItzTqboDhVkhy0zENCMg9bMahT2sa%2BQ%2BpgpUlKwjkDow8%2BuMDxAJZEUjOaU6DBUlhtakyyvSP5bLwex%2F21FQGGuSshAmyLTFVakyKRR5w59TZLNY5as49WP%2BPFbcj%2BREL%2Bjzz6a9D1w9MjVt%2FQRiED3ukm9n%2FpoL2gxvb2mkyU%2F44eH7%2FfxpGvoRbY%2FxFjdNfFvdST0kGAYitAoilDqzVLPjSHlXtP46F%2FXlTyT3L69rOelvLKwjk4ZUa3LYTefFh8dwOhWd1eG91na%2Fjto39EXX2685glsIQ0V3LG9D1DoHUgvPl%2FEsUPXmBO2qcSBA22HmSaj5Ik1AwQL5hCsSn01BPTpdbGDwnIwm%2BYJ3j%2FZnmhe[Compiler Explorer^] [source,c++] ---- @@ -420,7 +420,7 @@ include::example$troubleshooting/fix_overrider_smart_virtual_ptr_2.cpp[tag=conte [#overrider_parameter_type] #### `non-virtual parameter types must match exactly` -*Example* - link:https://godbolt.org/clientstate/eNptUl1P2zAU%2FSuWJ6FW7dqVPUwzoQ8TlbYHCALEC0GR67jJ1Rzbiu0Cqspv5zpNaNhoHqp7zr3H9%2BPsqJPOgdGOMvKwo1Dg%2F2JKqOK6DLyUGFIxmVCEnAmNaIEvoIUKhSQJGOcbyetlpjN9hCvvrWPz%2Bdogb5pyVoKvwnoGZm6s1LX0lSkO7ACYVda2QsGBLonmtXSWC0naRMaOmWcxC18OwpMrgy%2FuMk3wt4XGB67IawRHY3JOCrnhQXks2A%2BLrlVwhHW1H5j6JW9kCRi9YEJX%2Fg4x9oSTJNYoECAdY03QHmqZi0qKv27Zix1XsRks6Fea3t7l6fXq6nJ19zu9GFmcawPPUzLqOs%2Btb5LY1XJKnC9w5kP5yXhKtgaK8dlnOnl6v7q5%2BXOxGh3W8LlsnPldtmvrhBjXS%2FdLNI4kCcnoJKNxbZmOxxemtqBk0%2FrkEQH5LEXA23bG6XmMOhdRET10%2Bn3xLdYrWA8tRtuTRmKLmui%2FiC1%2BntJ91DbWd5akX7HdczTg4gfdD9q4BwdrFc244crJAZMGb4M%2F8njVSPOmDLXUvhWlQ%2BB%2FKXwSdJ%2FXBv%2Fk7B%2FxewMsExl8[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUktr20AQ%2FiuLCsHGql2nhxJF8aFE0B5qmTj0EgWxltbS0tXusg87xqi%2FvbN62AooUOkgzXyPeTBnLxPcEG68AL2cPXOSBP4gyWzFPR99BFdScJf2B8EaVx2akyinRqh38NZg4%2FCzR3P4LAFjmBeNYjZzVC2syhqLT5RnzOYEhVRoowiuVglP%2BDVdGiN1sFjsBOBCFfOCmtLu5lQshCS8IqYUeYsOEvNSysbIasoLxKFhLXFGUEMMgivz3rGgss0MWsM86JxwBM%2BBKmMxQ39dcjJFDygne2yZAUE9FG2Y1SjotO%2BQ6pQqUlCITkDo5JdUEBxhklAKRjNKdBAoyw2tSJqVJPujV73ZdRX7wYK%2Bx%2FH2OY030fpX9PwjfpxImGtP33w06TpPpVGh62rlI21ymLmV30x9dBA0n96P%2BaTx7%2Bjp6edjNGnXMG7rZr7Ydm3dIKF7636JQqMwRIk3Szy3toR7de2j%2Fz0v8kYy%2B%2FFxXY5o5MAcnTKimpTDbr8uvziA0Z1uT5x3VZqLcNChpS%2Fvbr36FWIhDRXcsb3PMOkDWC%2B%2FXc2xQzeYE7YtxZEDbY%2BZJoPisTU9BAfhEKwKPSoBfzpudlRY9mFdv8L7D%2FHTSSo%3D[Compiler Explorer^] [source,c++] ---- @@ -455,7 +455,7 @@ include::example$troubleshooting/fix_overrider_parameter_type_2.cpp[tag=content] #### `overrider return type is not convertible to method return type` -*Example* - link:https://godbolt.org/clientstate/eNptUstu2zAQ%2FBWCvdiwY9fpoSjr%2BFDEQHtoFKRBLlVg0NRGWpQiCT7cBobz7V0qcqymkQ7CzuzsQzt7HiAEtCZwwX7uOVb0XUwZ19LUSdZAIVeTCSco2ORVB7xDo3SqgC1D9GjqVWlKcwLREgyyfQU3Mbog5vOtJd76elZjbNJ2hnZuHZgWYmOrZ3YAzBrnukIpUCdmZAvBSQWsSxTilPk5Z1HnpCK7stRxXxpGzw59TFKzpwyOxuyCVfAgk44kOAxF1zoFJnrtP0z7uPFQI0WPlNDLXyAhftMmS2c1KoQghE8mYgsb1YD6FVbHYl%2BK4sftprheX31f334tLkc7qRNM2aifcOOiX%2Bbuq%2FGUoYnjN1Wb4m59c%2FPtcv2mPO%2BQ5SFWQjxfZ3z8ER5i8oaVfFLyvHtp8lmVbR1q8J0D7gmAP6ASHai3xJGnqPcHV9kd5x8W77Ne43ZoHt7dJRM7qknOytji0zk%2F5NrWxd5s%2FIxGvCBrLT7yw2CMOwy41dlmD1IHGDBFii7FE0%2BnybT0dWrBxK4oHwL%2Fl6KWaI55XfAq53BP719B7Q2a[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUk9vmzAU%2FyoWuyQKS5buMM1Lc5iKtB0WoqbaZVTIAResGduyn5NFEf3seyakSScqDQ7wfv8eD79jVGgFXEFEya9jBAfD8Q1B6RsVxeQtujFaBTi%2BKlas6dmSJ6UAbV%2FRG2AQ%2BGMkSnzMkZNMVZ1jMglSp70tuoh3QhXSl5wsHFihqmWmMnUBhUaYs%2BYfuAYwjs5mW428ttW0ElD77VTomTZcNRxqXZ7YK2BaG9MFeYediMIpnGEFJ52Q0ovyS1BhZ18AWeGQ5JgpgtdOWPBMkucAjsbklpT8iXkJaGivTWvpHaG99xXTHHLLK4HVAQW9%2FQWidI%2BTLIyWohDcUWq9AtHwvKh58dstz2Ff03TzkKfrZPUjefiW3o12THoek1H%2FhbkBuwjdl%2BOYCAXjQVee%2Fkzu77%2FfJYP2MEOwOygpPZ3O%2BPwjLAdvFcmiSRaF2TMVtW1M%2Fndx%2BB9e%2BLfX5mU9BlYnyIXktoMCd%2FNx%2FiEQUmzdaXlV36U71kDtTvL555uofcRaGxBaBXX0Hqe7xej5p0s4C%2ByaKS43td4rlD0x6fhV89TDmcJTDQyzlRu0YL4YDttbZs5l2z7i%2FRckRT1I[Compiler Explorer^] [source,c++] ---- @@ -492,7 +492,7 @@ include::example$troubleshooting/fix_overrider_returns_string_2.cpp[tag=content] #### `virtual_<> is not allowed in overriders` -*Example* - link:https://godbolt.org/clientstate/eNplUl1P20AQ%2FCunq4SCSJOGPiBc44eKqO1DMYKoLw2ynPPGXnG%2BO91HCorS3949x2AX7AfrZmd2d3yz5w6cQ60cT9jvPceKvosp47JUdShroCMXZ2ecIKeDFR3wAZWQoQKWonbeQtlma7VWA9x4b1wyn2801bWtZzX6JmxmqOfagGrBN7o6VkfArDGmaxQcqpqpsgVnSgGsIybJwPwSWTQ5CM9uNE3crxWjZ4fWh1KyvxGcnLIrVsG2DNKT4DAW3crgWNJr%2F6u0z4WFGun0TIRe%2FgolyR9ykhotUSC4JLFBeWyhEA2IR5e9aWZo7y0%2BFRg3PrrqIVrtaCUdOFO201hNehNFGrc7yabM%2BYrMH3%2F0yWnWDYjM1%2FaG3Ayy6O29rFN9zfP7VZHfLm9%2BLlff8%2Bvibvntx%2F1qeTfpW5FgB9ZiBem4eRblMQNCtwYl2C4uDwTAE4hAV9zn56VOpz5MXMQonX9efIp6iZtx0nh3s7FAU2MMI7a4POeH2Fsb3yeTfyQzV5TDxQU%2FjNb4hQ43MmZyW0oHo0oevAl%2BqNN9xHJp69CC8l1TPgbet6KRqF543eEN5%2FBA7z9q1yLk[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUktvm0AQ%2FisrKkWOQu06PVQlDoeqVttDjRX7VkdoDWNYddld7cOOZdHf3lkghjSOVDjAfq%2BZgTkFmRQWhA0i8usU2KMCfEOQu0oEIXmLrpQUHg4HhwWtOjaHec6s1C%2FolaXW86eA5fiYIsepKBrHzY2XGul01kS8YyLjLgcyY9JYDbSKN2Ijeri0VploMtlK5KUuxgWzpduOmZxIBaICW8q8ZQfAuFSqCXKGiYIIbNgomgFphFHUK%2B%2B8Ciu7zJIFzkNOG0Hw2jNtHeXkjwdH1%2BSe5LCjjls01EPTkjtDos77gqmOqYaC4emIgs5%2BhqLogJPMlOQsY2CiSDthWQVpVkL228T%2FhCnse8eeUuY7bqfqIGytHWXWa0KylywfdUOkM9%2FdVRwSY3Mcvv3QV9dxU8Arz%2FEKp%2BltfrbXtsb1JUlW6zRZzhc%2F5%2Bvvydf0Yf7tx2o9fxh1UWjYg9Ysh9kwPPb2oK5D8r9bBk%2BQubd37LxLF%2FbMyxkH3UCeu%2F04%2FeAJzram3XTRVWkWw1P7Vj79fBvUj3iWyjIpvDp4j9%2FhHqOnn%2Fpw6tklFcBXpTwIlO0oNzAonjj7TOGv9AzVhblowXx2OeygqXo%2B1vUj3n8BwYlSkg%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -519,7 +519,7 @@ include::example$troubleshooting/fix_core_overrider_virtual.cpp[tag=content] #### `method parameter must be an unambiguous accessible base of corresponding overrider parameter` -*Example* - link:https://godbolt.org/clientstate/eNp1Ul1v00AQ%2FCunQ0KJmiakPCCM6wdEBDy0qdqIF1xZznljrzjfne4jtIrCb2fPcRqnCPvB2pndmdvz7LgD51ArxxP2c8exou98wrgsVR3KGqjk4uKCE%2BR0sKID3qASMlTAUtTOWyjbLFe5OsGN98Yls9laE69tPa3RN2E9RT3TBlQLvtHVgR0A08aYTig4VDVTZQvOlAJY15gkp85PsYucg%2FDsVpPjLleMni1aH0rJ%2FkRwNGbXrIJNGaSngf1w6E4Gx5J%2B9oxpnwsLNVL1TA39%2BAuUJL9pk9RoiQLBJYkNymMLhWhA%2FHLZUUzI0jl2g%2Bp%2FNoY22uBTgXGXw749RIc%2BLJmeeiZsq7Ea9esVxts0amYT5nxFF3P4CW%2FHWWcRe18M2niGs8nuVK9HmXbj4y1qx9KU5fwy5%2FHeouTn5fJhVSzvFrc3i9W35ZfifvH1%2B8NqcT%2FqfUhpC9ZiBemZczYmiZgeoVuDEmwXtEcC4AlEoHD0yTvyVPUx5CKG8Or9%2FF2cl7geZpR3mYgE2cYAR2z%2B8Yrvo7Y2vs80v6Q1rynB8w98PzjGD3S4ljHNm1I6GDDL4E3wJ57%2BV6RLW4cWlO9E%2BRD4V4osUR37uuJVz%2F6R3r%2BdKTaW[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNU0uP2jAQ%2FitWKq1Ay0LZHqpmszlUjdoeFtDCrawik5hkVMe2%2FIBFKP3tHSfhVYHU5JDMfI%2BZcSb7IJPCMmGDkPzaB3anGL5hkrtKBANyC66UFD49OAsmtOrQnCU5WKkv4Lml1uP7AHJ8jBHjVBSN4v7eU410OmssPoDIuMsZiUAaqxmt4qVYilO6tFaZcDRaScSlLoYF2NKthiBHUjFRMVvKvEXPEsNSqcbIGRAFEdiwUTRjpCGG4Yn55FlY2WWWTHAesl8KgtcGtHWUkz8%2B2euTZ5KzNXXcoqA%2BF824MyTstBdItUs1KwCjHRI6%2BTEVhlucJFKSQwbMhKF2wkLF0qxk2W8TH8wyTo0hLyBulVE40RreU%2FCztPN2KWy6HTI6cQZkIyHvdeOlyurIe8YDYmyOB9N%2BhLt%2B3JTw3GOByvdwoWy6%2BldKpOkfTlEaEkVkGTwsA39u3vLrdDpfpNNZMnlJFj%2Bm39LX5PvP%2BSJ57XV10GnDtIacRReV4z5aBHU9IP%2B7n%2BydZe72dh638MqGejpwppuUxx4%2FjT96gMPKtP%2BI6Ko0K%2BWhTUsff3kM6jeMpbIghWcHD3hCz2g9%2Fnwypx6dUcH4vJRbgbQ15YadFZ86e4DwU3uE6sJclaA%2FXDfbaqoOYV2%2F4f0XvypmRA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -544,7 +544,7 @@ include::example$troubleshooting/fix_core_overrider_private_base.cpp[tag=content [#call_non_polymorphic] #### `no matching function for call to '_method_'` -*Example* - link:https://godbolt.org/clientstate/eNqlUtFqwjAU%2FZWQwajY6XQPY9X5MBS2h1lx4ss6pNZYL6RJaBKRSf99N7XO6nxbCw055%2BTc25uzp5ppDVJoGpDPPYUVrh2fUB6L1MYpwy1Nmk2KkJY2T0rgBkTC7YqRPkhtchZng0hE4gRvjFE6aLeXEnmZp60UzMYuWyDbUjGRMbORqwNbA1obpQb%2Ft2mDAAMxh29WOUbCahApKZVBcJIGwRZyY2O%2BUCbvOSH%2Bjk0MGUusvy%2Fq0IRbTYIz5iUMP2aLcDIav49mr%2BHQU%2Bi%2Fhp1PvJpv3x0Z%2BEQbrFfN67bhk62EVeOqzyKcj6bTt%2BHIiwTB57qta%2BjSlkh9dCb7w2GpSb9PItqMKBYrXD0QhmQxCO9XdGUypyl6hy6drhyCwk%2FvrDPPQVUribSmcajkUpPITAFneRmwLwTYjiUWb7NK3JHHXRU%2FmrjwdR869%2B48h2U9m7Ts1BFb9MTgOqzz1KWF85bKVFmmd9jMMya380iLWhtz0LDkLsXrmGtWY0JrlDUnHm%2Fd0XGe2owJU5rSOvDXCkuCOOrKzYWm%2BML3B23jLOw%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU1Fr2zAQ%2FitCg%2BEQL1m6hzE3y8OoYXtYHJqyl7oExVbtA1kS1intZvzfJ9lJ4xQXBrPB9n3fd9%2BdjnNDMyWRS6QRuW8o%2FtbcfTlQ2ErSkLxFV1pJD4eDYM2qI5vzOAdU9QW9RYaebyjk7rVwnGCy6DKmUy81ytZZZ%2FEOZCZszskSlMGas2qVylSe4RJRm2g%2B3yvHq7qYFYCl3c9AzZXmsuJYqrxnB8Cs1Hr1%2FzZzkIDABPzhR8dUWgOyIJ0yis7SKDpAjZaJncb62gvdcWyGZO2GRJp2CG2ENSS6YL4lyfZul2zi9c%2F47ntyE2jn%2FwjPIQkGvkufsgqJQVfvOK%2F3k5AcFOSTUZ9d8iu%2Bvf1xEwepJO4at%2FUNvbYlypycSdMnK0OWS5LSaUpdsdbXA4mkYiCDF9HIZM5TDPouva4bgnaP64vOAg8dW8mUxUlfibZtSP51L%2Fkzz%2BzbW%2FmyfSOb6eUgeN1Bnrv6tPjoCQF70%2F8b8lilO6inDr188eWKtg8uVhpBSa%2BmH9w5vjrrxeezOfPshkkutqV6kk72yIThg%2BKJxRPlFsYzrC7MaIrzh3Gzp5rpU9i2D%2B7%2BC9MTXJo%3D[Compiler Explorer^] [source,c++] ---- @@ -611,7 +611,7 @@ Passed a `Node&` that refers to a `Plus`, `final_virtual_ptr` makes a #### `class must be an accessible unambiguous base, repeated inheritance is not supported` -*Example* - link:https://godbolt.org/clientstate/eNptUslOwzAQ%2FRXLXECUlsIBYRaJpRIHIIgiLhRVrjNNRji2Fdssqsq3Mw6BhiU5RPM2J3mz4B68R2s8F%2BxhwTGn57DHuJamiLIAGrna3OQEeRtr1QBraJSOObBDtD7UIKvjiZmYFVyG4LwYDGaWeFsX%2FQJDGWd9tAPrwFQQSpt%2Fsh2gXzrXBEWPpmBGVuCdVMAaoRAr5UFS0clRBXZt6cTFxDC6nrEOUWr2nsD1DXbEcpjLqAMZll3TjY6eidb7g6nepjUUSNMbCVr7NyTEC33JobMaFYIXoo4mYAVTVYJ68se%2Fwi5hHn4c0%2BK3WJT%2FEqc2lIQnX69VtYmnWTa%2Bm2Y3o%2Bur0d1Fdj49uzwZj0fj9ZTR6zp6TcoGuVJrylYONdRNwY8EwCuoSKW0jX%2FxNLX1c5XK39kdbie%2Fxll3N3jTRSKeKZMWJ2HD%2FR2%2BTNnWhXaX%2BJYP%2BRFtznCPLzuvcY8eZzpt0VxqDx0mi8HFsOLphyRa1kWswIQmlHeBv1F0JJovXTP80iwf6f4A2e4Cgg%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNkl9vmzAUxb%2BKxV5alSVL9zCN%2FpHWLdIeuhCNvi1V5JgbsGZsy75uFkXss%2B%2Ba0IZUqTR4AJ%2FfOccYe5cIoxE0Jhn7tUtwa4HeSFSh0UnK3sKNNTrK6WAw401PS5iWEo07wgVyjHyXyJIeE2KK66pLXFxEqzfBia7indRChRLYtTQeHfDmdqEX%2BiDXiNZn4%2FHKEDeuGlUS67AaSTM2FnQDWJtyTwfCqLa2Kwpe6opp%2BmBvuQDWGbPs4LyKLpo5CGQzWg%2FbLTSj60k6DFyxv1E8O2c3rIQ1Dwop0A5DcxU8y%2FrsEWm2SweVpNGWDH38RcqyDa3k2holhQSfZS5olA0sRQ3it799VXYPazyaptd%2Fyqo%2BCe4M1qTHXNq7%2Bsa7PC8elvl8Ovsxffief1t%2Bvf9SFNPiLHakw0TatZxTKmnblP3vuYA%2FIMLbp%2BJl90%2BcjGiXClwnRXb5cfIhAiVXfn82dT9Lt5URPe3tk8%2BXSftIY2NRGh3dyXuP5Q1VTz4dynmkc65BFbXZaLKtufIwmDwP%2BIzoX0bCXeVPRqhfni7bOG6fh237SPc%2FnTkyMA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -637,7 +637,7 @@ include::example$troubleshooting/fix_diamond_inheritance.cpp[tag=content] #### `use_classes: a class is incomplete` -*Example* - link:https://godbolt.org/clientstate/eNplUstO6zAQ%2FRXLdwOitBQWV5iHBNxKdwGkUhEbiirXGZIRjm3FNg9V5dsZm0ADJItozjnzPFlxD96jNZ4LdrfiWNJ3PGBcS1NFWQGFXO3scIK8ja3KwB80SscS2DFaH1qQzenczM0GrkNwXoxGS0u8bathhaGOyyHakXVgGgi1LT%2FYHjCsncuFokdTMSMb8E4qYFkoxEZ5lFTUOarAri11XM0No%2BcJ2xClZm8J3NpmJ6yEBxl1oIR1P2mqo2eiy%2F3GNK%2BLFiqk6JUEXfoXJMQzbXLsrEaF4IVoownYwELVoB796Y9iV0i7ZOC8KGY3i2I6ub6a3Pwv%2Fi0uLs9ms8lsK40wyPMMPuTbpE%2FnVrZxqKHNztwTAC%2BgIl2zs%2BqTp6jzjavk2v7BeC%2Fla1z2TeX5iIl4oprkeMLGh%2Ft8nWpbF7qfgO%2F6UJ6Q5eO%2FfN0b4xY9LnWy%2F0FqDz2miMHFsOFp9UTLtooNmJCL8j7wuxS1RPOpy8EPzfqe3nfkEuqM[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNkl9P2zAUxb%2BKlb2ACO3KHqaZP9IGlfYwmkrhbUWV61wSa45t2dd0VRU%2BO9dpoQUVieQhued37rGdm3UmrUEwmHH2d53hygG9kahja7KcfYRbZ02S871iItotrWBcKbT%2BDS5RYOLrTFX0GBHTwtR9x8lJsgYbvewjvigjdayAXSgb0INor2ZmZnZyg%2BgCHw4Xlrj19aBW2MTFQNmhdWBawMZWG7onDBrn%2BqAYlKmZoQ0HJySw3sj5znmeXLRylMgmdB62nhlG16PyGIVmT0k8OmaXrIIHETVSQ7ffNNUxML7tfUPa1dxDrahakWHb%2FipxvqSTXDirlVQQOPfRoGphLhuQ%2F8LVu7BbRWfphV9FUd7Ni%2Bl4cju%2B%2B13czK%2F%2F%2FCzLcXmUtpD3%2B8k39mPyZ12Xs88OFP6DjB%2BP83VsB0aa7EqD76XEzr6Nviag1SJsfiqzXaWfQUKPG%2Fvox1nW3VNtHSprkjs7DVhdUvTo%2By5cJDoVBnTZ2KUh24PQAfYWLyK%2BIPpqiQhfh4MtlK8Ohy29cC9l193T%2FQx6QxpJ[Compiler Explorer^] [source,c++] ---- @@ -660,7 +660,7 @@ include::example$troubleshooting/fix_classes_forward_declared.cpp[tag=content] #### `a registry must be the last element of the list` -*Example* - link:https://godbolt.org/clientstate/eNplUcFuGjEQ%2FRXLvQSFQEkPVdyA1CZIPbTZSES5FISMd9gdxWtba5skQvTbO3aWsG3Xh9W8N%2B%2BNPW%2FPPXiP1ngu2K89x5L%2BkyHjWpoqygqo5Or8nBPkbWxVBj6gUTqWwK7R%2BtCCbGZLszQnuA7BeTEebyzxtq1GFYY6bkZox9aBaSDUtnxje8Codi4bRY%2BmYkY24J1UwHKjEKfOL6mLJkcV2J2lifulYfTtsA1RavY7gWcDNmUlbGXUgQSHvuheR89Ep%2F2LaV7XLVRI1Ss1dPJ3SIhnesm1sxoVgheijSZgA2tVg3rys6PZt6JYPKyL%2B%2Fndz%2FnD9%2BJ2ffPj62IxX5z17Id5%2FDDfZUCqtGNlG4ca2hzHigB4ARVphV0%2BR56qLiyuUlSXnyYfk17jpp8kz5tLxI48KeaETa4u%2BSF5Wxe65PmFD%2BWUcp585ofeNR7R40anzLdSe%2BgxRQwuhhNPy0u0bKvYgAnZlPeB%2F61oJJpjXy7%2B6Tms6PwBSOjmng%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUl9r2zAQ%2FyrCe2mplyzdw5jWFrYusIc2DrhvSwmKfLVFZUlIp2YheJ99JydpXEhh9oN9v38n6bTNpDUIBjPOfm8z3DigPwJ1bE2Ws%2Ffo1lmT4HxQzES7ZyuYVgqtf0OXKDDx20xV9JkQp4Wpe8fFRZIGG73sIz4oI3WsgF0pG9CDaG8WZmGOcIPoAh%2BPV5Z46%2BtRrbCJq5GyY%2BvAtICNrXbsABg1zvVBMShTM0MLDk5IYL2Q86PyW1JR5yiRzWg%2FbLswjJ4X5TEKzf4m8OycXbMKnkTUSIZuaJrrGBjfe98w7WbpoVZUbUiwt79CnK9pJ1fOaiUVBM59NKhaWMoG5HO4OYT9KIryYVnMp7P76cOv4ufy9u57WU7Ls0F83rfP%2B7Wckyvrupz97xThD8j4%2FgxfZ3VijkmuNPgeStzl58mnRGi1CrubZPZd%2BoNP1MtOPvl6mXWPVFuHypqkzj4GrK4pevLlGC4SOxcGdNnYtSHZk9ABBs2LiAeKzj0xwtfhpIXy1emwtRfuUHbdI73%2FAMoHFls%3D[Compiler Explorer^] [source,c++] ---- @@ -683,7 +683,7 @@ include::example$troubleshooting/fix_classes_registry_first.cpp[tag=content] #### `do not wrap an object that has a boost_openmethod_vptr overload in a virtual_ptr...` -*Example* - link:https://godbolt.org/clientstate/eNqlUstu2zAQ%2FBWCAQoHae04OQRhHX9Cm0OQSx0IFLWRFqVIgly6DQz327NU5Fh53CoBEnZmdpZczE4mSAm9S1KJXzuJDf%2BXX4W02rVZt8ClNGdnkqHkczQDcILO2NyAWKFPFEH3643buCPcEYWkFovaM%2B9jO2%2BRulzP0S98ANcDdb55YSfAvAthMMoJXSuc7iEFbUAMQqWOyu9FxZOzIfHD88Tdxgl%2Bthgpayv%2BFXB2Km5EA486W%2BKG%2FbTp1uYk1Nj7humfqggtcvXEgrH9FVLqD99kFbxFg5CUitkR9lCZDszvtD6Y%2Fe8qFuiC5atX20DxdS%2FjEe8g9ny2qaSqdYJVIdYfdlHQT3ex9diIENHRrGi%2BCOLv6bv%2Bit1H4zAbBKV%2F40oijO8DWohDeB4YgL9gMt9yTNOB52qMljQlWBeXy%2FPSb7Ge5k4OWyjElj05lAVbXl%2FIffH2gcacym%2BJmhtO5fJK7ifHuMeEtS0JfdQ2wYT5mSlkOvK8x0Lr2OYeHA2mcgp8tOKR6A66oXin2T%2Fw%2BwxeBSgL[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlUl9r2zAQ%2FyrCg5HSLFm6hzEvzdteu0L3tpSg2Ff7mHwS0ilZCN5n38lxEndLoVAbbN%2Fvn6Tz7bPCEgNxlquf%2B4x3DuRLQBMbysbqJbpxlhI8HhR3uunZEr6VyNY%2Fox9Yc%2BL3GZbymglnNFWd4%2Fo6SYONvugi3iEVJpag5mgDe9DNYklLOsM1swv5dLq2wltfTSrkOq4naKfWATXAtS0P7ACY1M51QTEgVYpkw8HpAlQnzPOz8mtSycqxYHUn51H7JSm5Nug5aqP%2BJHB0pW5VCU86GhZDOzTdmxhU3nufMc1u5aFCqXYi6O0nKM%2B3cpK5swYLhJDnPhJjA6uihuJXWBzD3tqKKZIzcvTVxrE%2F9aXf4g%2FwjextKFmtdYB5Ihb%2F9SKhF3uxsVgq55F4lDTvFcvz6h%2F%2FStL7YDfqBMm%2FpKxtx%2Bq1Mwe%2FoYgvT9xpsi5MXZKjAd9Bibv5NPuYCIPrcJh76lfpmpiozUE%2B%2B3KTtY9SW8doKamzD4HLW4mefT6H68TeawLzUNstiexJmwCDxb9HPlLyCxKjfRUuWiQfL4dtvXbHsm0f5f4LYhBXuQ%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -708,7 +708,7 @@ include::example$troubleshooting/fix_wrap_inplace_vptr.cpp[tag=content] #### `class must inherit from inplace_vptr_base` -*Example* - link:https://godbolt.org/clientstate/eNqlUstOAjEU%2FZWmbjQgCC6MFfkDHys3YkjpXGdu7LRNHygh%2BO3e1gFGXTpdTO45577as%2BUBQkBrAhfsecuxov9kyLiWpk6yBgq5Ggw4QcEmrwpwgkbpVAGboQ3Rg2znC7MwR7iJ0QUxHq8s8dbXoxpjk1YjtGPrwLQQG1t9sz1g1DhXCqWApmZGthCcVMCKUIij8iarqHNSkd1b6rhdGEbfGn1MUrPPDJ6esVtWwatMOlLCrp%2F0qFNgosv9wbSbpYcaKdqQoEs%2FQEK80yYzZzUqhCCETyZiC0vVgHoL832x%2F17FGI3TtPpy7aI%2F3Es34h2aw%2FRD1lcuK%2FC4hmpWJMOi6GbKL6hs61CDL4%2F9QgB8gEo0Vff6e56izgpcZSNMLycXOV%2Fjqu8TXqbOxJpqkokyNrme8l2ubV3sfMXPQ6xuyUWTK77rjfGEAVc6O%2BpV6gA95iFFl%2BKRp70zLX2dWjCxFOV94G8paolmryvBL83uhc4X%2Ft0MWA%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlksFu2zAMhl9F8C4r6iZNdxjqpr3tuK5Aj0sRKDZrE5MpQaKSBYH37KMcJ3GBFChQ%2B2CT389fpMBdVlpiIM4K9XuX8daB%2FEnSxJayXL2HW2cppfNR8KjbgVbwo0K2%2Fg1%2BZs2J7zKs5DMTZjTVfcXlZZIGG33ZW3xBKk2sQM3RBvag24cFLeiUbphdKKbTlRVufT2pkZu4mqCdWgfUAje22tNRYtI41xvFgFQrkoaD0yWoXlgUJ%2BVdUsnJsWT1KPOo3YKUPGv0HLVR%2F1Ly64W6VxW86mhYCrpx0ZOJQRVD7RvSbpceapRoK4Kh%2FJgqio1MMnfWYIkQisJHYmxhWTZQ%2FgkPB7PPXsUUyRkZfbl27I%2F3MrT4E%2BnYfa7GymUFHtdQzXtJ3iuGnrKuy9VHdwT%2BQhnf35DjJpzZkiRHA75PJXbzbXadgMFV2O8pDaf0Qye03stntzdZ9yKxdYyWkjq7Clzdi%2FXs%2B8lcJ%2FqkCcxzYzcksldtAowO%2FxX5gOTKEtG%2BDmdLxB%2FPm228doew617k%2FQ8G%2FDwG[Compiler Explorer^] [source,c++] ---- @@ -733,7 +733,7 @@ include::example$troubleshooting/fix_inplace_vptr_derived_not_base.cpp[tag=conte #### `registry can be specified only for root classes` -*Example* - link:https://godbolt.org/clientstate/eNqlUstOwzAQ%2FBXLXECUlpYDwpR%2BAiCBuNCqcpxtssKxLT8KqCrfzjqkbShHkkO0M7OzXmc2PEAIaE3ggr1uOJb0HQ8Y19JUSVZAJVfn55ygYJNXLXCCRulUApuiDdGDbGZzMzcHuI7RBTEaFZZ466thhbFOxRDtyDowDcTalj9sDxjWzrVGKaCpmJENBCcVsFYoxEF5m1U0OanI7i1N3MwNo2eNPiap2VcGT8%2FYHSthJZOO1LDtNz3qFJjoen8xzefSQ4VUfZKga99DQrzTJlNnNSqEIIRPJmIDS1WDeguzndl%2Fr2KExmlafbl20e%2FvpTviM%2FiGztaXLAsZYJqJ2dE%2BTylrMzP43VGCxzWUUxIMOr63e2eT%2F7uyjUMNvo3IggD4AJVoly4zO56qLkBc5fhMrsaXuV9j0U8Xb3fNxJo8KXoZG99M%2BDZ7Wxe7NPKLEMs7yt74mm97x3jBgIXOOVxJHaDHPKToUjzwdAGZlr5KDZjYmvI%2B8NeKRqLZ6driSLNd0PsNIL0gqQ%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlksGO0zAQhl%2FFChfQhpYuB4Tp9sZ1Wanc6KpyndlkhGNb9rilqsKzM07TNkVdCYnkkMx8%2F%2Fz2jOZQaGcJLBVS%2FDgUtPfAf5w0qbVFKV7DrXc2p8tR8KjagVbwtUJy4QovSVHmhwIr%2FsyYGWXrvuLuLkujS0H3Fm%2FQapMqEHN0kQKodrGyK3tJN0Q%2Byul045i7UE9qpCZtJuimzoNtgRpXHekoMWm8741SRFsLyxeOXmkQvVDKi%2FJLVvHJSZN45H7EYWUFP1sMlJQRv3Py7TvxICp4UckQF3TjoieTopBD7RVp9%2BsANXK0Z8FQfk5JueNO5t4Z1AhRypAsYQtr3YD%2BGRcns%2F8dxRStN9z6euspnOcyXPE7hJbvNpasNyrCPIPFX%2F0sU9ZmUl5XVBBwC9WcBeXAR70PNkXXleJfNwt%2BgU6v79V5f27sVpajgdCnMrv%2FOPuQgcFNPG63HU7pR5XR9iiffb4vumeOnSd0NquL95GqB7aefbqYq0yflAWzbNzOsuxFmQijw78lOiGeXSYq1PFmCfvjbbNdUP4Udt0zv38AkJNQVw%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -757,7 +757,7 @@ include::example$troubleshooting/fix_inplace_vptr_derived_registry.cpp[tag=conte #### `the rtti policy deems this class polymorphic, so it must provide dynamic_type` -*Example* - link:https://godbolt.org/clientstate/eNqNU21v2jAQ%2FiuWJ1WgtjC6D9NSyE%2FYpgnty6gi45jkNMe27DMrQtlv39kNJbB%2BaJBI%2FDz35rt7jjyoEMCawAv268ihpvfijnEtTBNFo%2BjI5e0tJyjY6GUGPoCROtaKLfHgVIVeAIZyYy5xMDtL4BgGG9Ar0V3BLaILxXy%2BtcRb38wawDZuZ2Dn1inTKWxt%2FcKOgFnrXA4UA5iGGdGp4IRULBsWxdnyMVlR5iiRfbWU8bgxjJ49eIxCs78JnEzZitVqJ6JGcujHTt91DKwYfC%2BY7lB51QCdDmQwuL9CRfGHbrJ0VoMEFYrCR4PQqUq2Sv4O5RvBEIECjTwSMNSLqnNaoFpKLUJgP4Ys5Qs7BNmZcyHh5PmG97o8UwEFgmSS9gDVs%2FOphZpBqKiOQ2e9a4ldkVldFJdotV%2Buy3yH96cREe3wXaVFoc7flyyvEtTjitPjFUZv2E3eqHqynj6e%2Bf7ls78eV%2BrZO8YytPt1CntL6Z0Hg5M06Rtm6H96tSyVQ79M9N1lmpK5SbZPxWxMEoy0nQOtfNbWEwHqWUm6ux%2FEduLpNCiPy6S7h0%2BLj8lfw3YsS573OhF7ikmaTdjiywPvU2zrcJAxv6c5rUi0i8%2B8H5XxEwJsdRLwTuigRsy3iC7imacuJlr4JnbKYA7Kx8D%2FoSglmJNdPlzZ9E%2F0%2Bwd4toXp[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNVN9v2jAQ%2FlesTKpApTC6h2ku5G2vXbXytlaRSUxymmNb9hmKUPa37xwCBEQlEinY3%2FfdD%2Fvu2CW50Sg1Jpz92SW4tZJWBKpQ62TEPqNra3SER73Ns6g7tpA%2FC0DjzuhXFBj5XQIF%2FUyJU0KXrcX9fZR6E1zeuvgCOlehkGwWQ2boBKBP3%2FQ5DnplCOzDYDw6KeoLuEK0nk8mS0O8ceW4BKzCcgxmYqzUtcTKFHu2B4wra1tHwYMumabzeStyyVoh5yflU1RR5JAje6bjs92bZvSswWEQiv2L4GDI5qyQKxEUkkHTN3pRwTPe2Z4x9TZzsgTabUnQmR8hzjd0kpk1CnKQnnMXNEIts7yS%2BV%2BfXnGGCOSoZxGBLl%2BUtVVUplmuhPfsdxcl3bOdk5U%2BJeIPllesF%2BmJ8lR8yBl1k0f5YV28QsXAZ5THtjbOVsTOSVZwfo5m69kibc9wexgR0HTrLDYK3fxDytpWgqKfcXycxOA0u2s7qhgshk8nvtkvm8tyxTu7oSzddR%2BrsDYU3jrQOIiVvmOavsOLZsksulmkR%2BdhUmYHrT4m86aTphmxW0dSfsg8fD6Qx8G7MpRRDkq6Forc47fp10goWPr934LuorRjEan1Xj798Zg077Q3FoEqH7EHKvGcXE%2B%2Fn5yLyL4ILdVrZTaaZCuhvOwF%2FxXwQFEBIiNc6a%2BakH%2B47mzjhD1sm%2Bad3v9BHbWX[Compiler Explorer^] [source,c++] ---- @@ -783,7 +783,7 @@ include::example$troubleshooting/fix_rtti_without_dynamic_type.cpp[tag=content] #### `the rtti policy does not deem this class polymorphic` -*Example* - link:https://godbolt.org/clientstate/eNplUsFOwzAM%2FZUoSGgI2BgcEAH2BQg4cWFoylLTWqRJlDiDaRrfjlM6VqA9tH7Pfo7zvJEJUkLvklTieSOx4u%2F0REirXZ11DRxKc3wsGUo%2BR9MBB%2BiMzRWIG%2FSJIuh2Nndzt4cbopDUZLL0zPtYj2ukJi%2FH6Cc%2BgGuBGl99swNg3ITQCeWErhZOt5CCNiC6RKX2mdcliztnQ%2BLec8fN3Al%2BVhgpays%2BCzg6EreigledLXHBdlj0aHMSqq%2F9xbTrRYQaOVpzQl%2F%2BAyn1zpPcBG%2FRICSlYnaELSxMA%2BYtzf6I3SFB5PP06MpjJUJER6OeORT2%2B%2BdoN8L%2Fjl2z9aDnKlCcKVWt%2BYbQLEo42smUQeeu2GV8G9BC7Jx9YQA%2BwGR2o7d6x3PU%2By5Ncf38YnpW6i0uh0shOxMKsWJN3piCTa%2FO5bZo%2B0D9EsnTRNUtr8z0Um4Hx3jChEtb1udV2wQD5iFTyLTn%2BeoKrWOdW3DUicoh8F%2BKW6Lb5XXBn5ztC79f6x0FIA%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUsFu2zAM%2FRXBA4YUTZOlOxRT29x2G7oCPS5FoMiqTUymBIlKZgTet49ynMbdUmDWweJ7j4%2BixH2hHZJBKqT4sS%2Bo9YZ3DNrUYDEV79GNd5jh6Sh4UM3AluZrCeTCG%2FqJFGV%2BX0DJvwVzVmHVZ1xeZml0Keje4gOgtqk04g5cpGBUs1zhCk9wTeSjnM83jnkXqlkFVKfNDNzceYONodqVB3YEzGrve6MUASuBfODolTaiF0p5Ut5mFVdOmsQD9yP2KxT8bSFQUlb8zuDkQtyL0ryoZIkTunHSo01RyCH3DdO062Aq4KhlwZD%2BCkm5407uvLOgwUQpQ0KCxqx1bfTPuPzL7BuQCXyeAd06KIUPgDQZmI%2FCHjYXxxb%2BrdgXa0c1t57CUsqy5RsCvc7h5GiTG11h0XVT8b8DYX4Znd4fh9dnPzMSWQ7WhB7K3PXnxadMWNjEw1DiUKV%2Fw0xtD%2FLFl%2Buie%2BbYeQKHWV1cRSrv2XpxczJXmX1UaOxT7XbIshdloxkV%2F57oSPGtZ0aFKp5NYX84b7YLyh%2FDrnvm9QdGtzTO[Compiler Explorer^] [source,c++] ---- @@ -815,7 +815,7 @@ how a class, a parameter and a method come to belong to a registry. [#registry_mismatch] #### `registry mismatch` -*Example* - link:https://godbolt.org/clientstate/eNplUl2P0zAQ%2FCuWkU6pLrT0eECYXh8QJ%2FHC5SROvNBT5TrbZIVjW%2F4od6rCb2edpjRAIiXamd3ZtXeOPEAIaE3ggn0%2FcqzpvywZ19I0STZAIVfX15ygYJNXA%2FAKjdKpBrZCG6IH2a03ZmMucBujC2Kx2FnirW%2FmDcY27eZoF9aB6SC2tj6xE2DeOjcIpYCmYUZ2EJxUwIZEIS6ZH3IWdU4qsntLHY8bw%2Bg5oI9JavYrg8WM3bIa9jLpSAX9tOhBp8DEWPsX071sPTRI0QsljOV%2FICF%2B0klWzmpUCEEIn0zEDraqBfUjrM9iH6vq6%2BO2eri7%2F3L3%2BLn6VJzmc3SOPT6XrBgn3broV3mKdclCrOmMp%2Fu8mpXsYLEup%2FPMBukMMyW1LvIhrpij7%2Bx8AWODIoOjorIp5sp%2BY%2FIWle0cavDDwp8IgGdQiZY0OuDMUzTagatshpu3yze5XuNu6hU%2B7CYTB9IkI2Vs%2Bf6G91nbujh6i7%2BmYW7JSct3vJ%2BM8Q0D7nR21V7qABOmStGleOFpPZmWvkkdmDiI8inwvxS1RHPOG4J%2Fcvonen8DQBcI9A%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUsGK2zAQ%2FRXhwuKwbtJsD6VqNofSQC%2BNA9lbswRFVmxRWRLSKNkQ3G%2FvyHY2XshCbbA97715M2PNOeFGg9CQUPL7nMDJCvxCUIVaJxl5j66t0RHOBsGS1T1biEUhwbg39BoYRP6cyAJfU%2BQU02WbcX8fpd4Ex1uLD1JzFQpBZtJ4cILV843e6CtcAVhPJ5OdQd64clxKqMJuLM3EWKFrAZUpOnYAjCtrW6PgpS6Jxoa9ZVyQVkjpVfktqrBy4ECWOA85bzTB6yAdBKbI3wimI%2FJICrFnQQEmNMOklQqe0D73DVOftk6UEqMTCvr0V4jSI04ys0ZJLoWn1AUNshZbXgn%2Bx88vZt%2FzfP20zVeL5a%2FF08%2F8R9r1Z3GOvXzJSNp3urXgZrGLeUY8FDhj9z%2FvRhk5GFlkw35GrXWECWdKpXGIO2LxObr8gL5AGsHekZsAMbPZ6KRpMvK%2FeyJeBA%2Fvb8nrNtzYlCiXSrgWitzD5%2BmnSCi5892u6r5Ke7SROnTy6deHpHnG2FiQRkd18hHneETr6ZerOYvsimmh1pU5apTtmfJiUDwPcKHwZCPDXOlvpqC%2FvG12dMxewqZ5xvsfLDs4og%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -841,7 +841,7 @@ include::example$troubleshooting/fix_registry_mismatch.cpp[tag=content] #### `registry mismatch: the parameter belongs to another registry` -*Example* - link:https://godbolt.org/clientstate/eNplUlFr2zAQ%2FitCg%2BJQL1m6hzE3ycNYYC%2BrCyt7WYpR5IstJkvCkrKU4P32nhSndhMbbO777r67k74jtWCt0MrSjPw5UlHif54SKpmqPKsAQ8pvbylCVvuWR%2BCDUFz6EshCaOtaYM1qozZqgGvnjM1ms61GXrfVtBKu9tup0DNtQDXgal2e2BEwrY2JQt4KVRHFGrCGcSAxMcuGzPuQhZ09d%2BRBY8fjRhF89qJ1nknyP4DJhCxJCTvmpcOCblz0KL0lWV%2F7jmleihYqgdELJvTlb1CW%2FcNNFkZLwQXYLGu9cqKBgtfA%2F9rVhdj6YNqr2QJ4MVvgT0vHVYth02GY5Xi0t32%2B5fmvpyJ%2FXD%2F8XD%2F9yL8nJzGDKjtxSEnSty0Woe3NKiXWlXiUp2u7maRkr0WZXi06ieqBI5xJmcRqAvidnBfqeyQB7GW59i5UdhsVHMN1Y4SENprrGQE4APdoiN5tZx6j3nqUB%2BPdfZ5%2FCvVSbMe%2BpPFwArFHTTRtwOZf72gXtLVxvY%2FpRxxmia6df6HdaIzfwoqtDA7eMWlhxOTeGe8GHm8v0KytfAPKRVE6Bq6lsKVQ57wYXOR0z%2Fi%2BAhUrL%2FU%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNU11vmzAU%2FSsWkyqi0qTpHqbRJA9TI%2B1lIVL6tlTIMQ5YM7blj3woor%2B910ACbVNpIAE%2B59xz7wFzCogUlgobxOjvKbBHReEJQO5KEUToK7pUUng46i0WuGzZjM4zZqV%2BR68stp4%2FBSyD2xg4jkVeV9zeeqmRTpPa4hsThLuMogmTxmqKy9larEUHF9YqE49GGwm81PkwZ7ZwmyGTI6moKKktZNawPWBYKFUbOcNEjgQMbBQmFNXCOO6Uj14FnR2xaAF50GktEBw7pq3DHL16MBygKcroFjtuoaDqFy25Myhua98x5THVNGewOoKgLb9AcbyHJBMlOSOMmjjWTlhW0pQUlPwzsw9m84PSn2bz4IfZPN%2BErqOmXdJumGl%2FtEueX0myek6T5XzxZ%2F78O3kKGzMFLlt2iFDYtk0nvu3NLELGZvAqm892M4jQTrIs%2BhR0ULt7DhHMeVhXIwrXwTlQ2yP0YGtLpLO%2BslqLoKoi9L97kh4ocV%2FvyMvOu7IrvZxxqmvIcw%2Ffx%2Fee4Gxjmv9CtF3qd%2BupXSMf%2F3wIqhdYS2WZFF4d3EGOKViPf3Tm2LNLLChfFXIvQLbF3NBe88TZMwUf3jNY5%2BZqCfiz62Z7jdV5WVUvcL4Bhe1fow%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -874,7 +874,7 @@ include::example$troubleshooting/fix_registry_mismatch_parameter_2.cpp[tag=conte #### `registry mismatch: a class declares an affinity for another registry` -*Example* - link:https://godbolt.org/clientstate/eNplUstu2zAQ%2FBWCvSSIa9fpoSgbB%2BjDQA9tFEBBL3Ug0NRGWpQiCT7SBIb77V3KSqXa0kHYmZ3ljjg7HiAEtCZwwX7uONb0Xc4Y19I0STZAJVcXF5ygYJNXPfAKjdKpBnaFNkQPsrvemI0Z4TZGF8RisbXEW9%2FMG4xt2s7RLqwD00FsbX1gJ8C8da4flAKahhnZQXBSAesbhRg7P%2BQuOjmpyG4snbjbGEbPI%2FqYpGZ%2FMnh2zlashgeZdCTBfiq61SkwMWj%2FY7rnykODVD1TwyD%2FBwnxm5xcOatRIQQhfDIRO6hUC%2BpXuD4atn5y%2FmS3DB7tlvmD6d5qNTodl1lNVzv2U6aOtj0cdyA%2BFUV5VxW365vv67uvxZfq87ePZbkuz3LTLAtmJ%2B7OSZlvWtnOoQbfh%2BKeAHgClegih5S88FQNkeEqB%2Bby7fJN1mvcTvPEe1OZeKSZFLaMLd9f8n2ebV0c8sdfh1ivKG3Ld3w%2FWeMHBtzqnLwHqQNMmCJFl%2BLI08%2FItPRN6sDEfiifAqej6Eg0L319cdSzv6f3L9NzF3g%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNkl1P2zAUhv%2BKld2AyNoVLiYyirSPSLsYTaVwt6LIdQ6JNce2%2FEGpqvDbOU4KCaVISy4Sn%2Bd9z4d1dhFT0oF0UUL%2B7iK31YB%2FGBS%2BkVFMPsKNVjKE49FhQZs9LSEtuVPmDc4ddYHvIl7iZ4ZMUFl1jrOzILXKG9al%2BMQlE74EcsWVdQZoc72SKzmEa%2Be0TabTtUKuTDWpuKv9esLVVGmQDbhalT0dBSa11l0ib7msiMSGraYMSCdMkkH5LaiwsmeOLHAesltJgs8DN85TQZ5C8OSUzEkJ99QLh4Z2bFoKb0my974hzbYwUHE8bVGwt7%2BGkmSDk1xpJTjjYJPEeOl4AwWrgf2z1wfJ0kdt3vUWgge9Bd4P3Y1aDJMOzczHrR3Ok%2FsGu%2B3L9eBHluW3RbZMFzfp7e%2FsV%2FHzz%2Fc8T%2FOTIIqDIX433Sk6o7aNyf%2FuEjwC8x9v0uvGHNmmIOcCTBcK7Pxi9iUAwde232e5r9LdSUAPvXx2eR61d3hW2nElgzr6bF05x9Szr0NyGuiSShB5rTYSZfdUWBgVz7x7QXiPgVBT2aMWzM%2BPJ9sYql%2BObXuH7zPcJEcm[Compiler Explorer^] [source,c++] ---- @@ -907,7 +907,7 @@ include::example$troubleshooting/fix_registry_mismatch_classes_2.cpp[tag=content #### `virtual parameters carry conflicting registries` -*Example* - link:https://godbolt.org/clientstate/eNplUl1r2zAU%2FStCg%2BDQLFm6hzEvycNYYC%2BrCyt7WYpRZNW%2BTJaEPrqW4P32XslO7aU2yNY59557r3RO1AnnQCtHc%2FL7RKHC73pBqGSqDqwWuKX86ooi5HSwPAHvQHEZKkE2oJ23grW7gzqoEW68Ny5frY4aeW3rZQ2%2BCccl6JU2QrXCN7rq2QmwbIxJQsGBqolirXCGcUFSYJ6PkV9iFFYO3JMbjRVPB0XweQTrA5PkXwSzOdmSSjywID0mdNOkWxkcyYfc%2F5j2ubSiBtw9Y8CQ%2Fgrl%2BV%2BcZGO0BA7C5bkNykMrSt4I%2FsftLsT2T8a%2B6S2CF71Fvh86jVqOk47NbKetvc7ztSh%2B3pXF7f7mx%2F7ue%2FEt68WMBeUXJBuKlsbbTRx2tyBTKLaCkPMVnm5%2Fk7M5hmio5kk%2B%2FhHOpMziic2IwXWRxpoRgev8PF0qmPV0JAZRroOPSt1BRQtx3RqQwia33SMgngQP6JDBfmced4MXKY9OvP64%2FhDzJRynRqXptCLxiJro4oitP1%2FTLmpr4wdj0%2FfYzBZtvP5Eu0kbv8DBUUZLPzDpxIQpgjfBjzxeZ6SZrUMrlE%2BidAq8lcKSoM5xaXMR093j%2BwKJJTVu[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNU9Fu2jAU%2FRUrk1BQUxjdw7QUeJiGtJcRJPpWKmQcN7Hm2JZ9XYpQ9u27TgKkHZWWSCE%2B59zje5zLMWJaAVcQpeTxGMHBcHxDUPpKRQn5iK6MVgFOeoslrTo254tcgLZv6DVQCPwxEjn%2BTJCTVBVNxc1NkDrtLWssPgnFpM85mQrtwHJazTdqoy5wCWBcOh7vNPLaFqNCQOl3I6HH2nBVcSh13rI9YFQa0xh5J1RBFDbsDGWcNMI0vSjvgwp39gzIEvOQ40YRvF6EBU8l%2BRPAeEhmJOfP1EvAgrpftJLekbSrfcNUh63lhcDVAQVd%2BRlK0z0mmRotBRPcpan1CkTFt6zk7LebvzNbvBr7T28BfNdb4NvQTdTtJemlmVm%2FtXOe71m2fthmq8Xy1%2BLhZ%2FYjbs2MFQoSEnebbg3YaQg7T0gfCq0g5CDH022%2F5GCIEi3yYWMf3gijUsbhxAbE4DNpYg0Ix%2BfwlK7ZMG7pQHSmTHsITvVGRXWdkP8dUv7Kmf94RM%2BjeGVMg1xIbhsocHdfJp8DIcXOtX8U1e3SHHagXlr55NtdVD%2FhWhsQWgV1dIs5Zmg9%2BXoxp4FdUcXlutR7hbJnKh3vbZ55OFE4CYGhtnBXS9BfXDfbW2pOy7p%2BwvsvFhRlHA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -942,7 +942,7 @@ include::example$troubleshooting/fix_registry_conflicting_carriers_2.cpp[tag=con #### `the classes carry conflicting registry affinities - list the registry to say which one is meant` -*Example* - link:https://godbolt.org/clientstate/eNplUk1P4zAQ%2FSuWuYDothQOCEORlqUSh11SqWgvFEWuMyTWOrblDz5Uld%2FO2ASSLckhmvfejOfFb0M9eC%2BN9pSR%2Bw2VFX6nI0IV13XkNWBJxeEhRcib6EQG9qQWKlZALqTxwQFvL1d6pXu4CcF6NpmsDfLG1eNahiaux9JMjAXdQmhM9cEOgHFjbR4UvdQ10bwFb7kAkoWM9crzpMKTowjk1uCJm5Um%2BDxJFyJX5C2B%2BwdkRip45FEFbNgOmxYqesK63v%2BY9rV0UEusXlHQtX9BjD2jkwtrlBQSPGMu6iBbKEUD4p%2B%2F3Bk2f7Hu224J3Nkt8R%2Bms9Wyd9ovMxuu9uXnqiiWd2WxmN%2F%2Bmd%2FdFNflr98%2Fl8v5cj9ZG2Wfo7zGAcrTLQrTWqnA5Qt%2FQABeQES8pC4BnzxWXRyoSGE4PpkepX4l18Os0LxwIp5wJgYpYdOzY7pNs40NXbboDx%2BqGSZpekq3gzX%2BSi%2FXKqXqkSsPA6aIwcbQ8%2FhHE81dHVvQIQ%2BlQ%2BD7KDxS6k9dLnY02wd83wHakwm2[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNkstu2zAQRX%2BFUDcJotp1uijKxgH6ENBFaxlQdnUg0NJEIkqRBB9xDEP99g5px1ISB4i1sHjPneFcaHZJpaQD6RJK%2FuwSt9WAbygK38kkJa%2FhTisZ5HR0WLDuQGvIau6UeYILx1zgu4TX%2BDdDJphsYsXFRbBa5U0VW7zjshK%2BBnLFlXUGWHe9kis5yK1z2tLpdK2QK9NMGu5av55wNVUaZAeuVfWejoRJq3Vs5C2XDZE4sNWsAhKNlA7OL8GFN%2FvKkQXmIbuVJPi758Z5Jsi%2FIJ6dkzmp4Y554bCgHxcthbeEHmqfkG5bGmg4nrZoOJQfJUo3mORKK8ErDpZS46XjHZRVC9Vfe%2F2sWfagzYvZgvhstsD3oWPUckg6DDMfj3bM8y3Pi5syX2aL39nNz%2FxH%2Bf3X16LIirMQLY050zjGOdqTvk%2FJW%2FcEHqDyr2%2FJcRtObEqwcwEmSoFdfpx9CEDwtd3vqjzcEvMGdL%2B3zz5fJv0tnpV2XMngTt5bV8%2Bx9ezT0JwFumQSRNGqjUTbHRMWRpfn3j0i%2FBiBMNPYkyXYn59utjFMPx77%2Fhaf%2F%2BmTOWQ%3D[Compiler Explorer^] [source,c++] ---- @@ -977,7 +977,7 @@ include::example$troubleshooting/fix_registry_conflicting_affinities_2.cpp[tag=c #### `cannot tell which registry this class belongs to...` -*Example* - link:https://godbolt.org/clientstate/eNqdU01v2zAM%2FSuCBgzJ6iZLdxjqpTkMC7DLmgINdlkKw5EZm5gsCfrIUgTZbx9lu43r3GYfDL1H8j3K5JE7cA61cjxlv44cC%2FrOEsZlrsqQl0BHLq6uOEFOBysa4B0qIUMBbI7aeQt5vdiojTrDlffGpdPpVhOvbTkp0VdhO0E91QZUDb7SRcv2gEllTFMoOFQlU3kNzuQCWBOYpufILzGKlIPw7F6T4nGjGD17tD7kkv2N4GjM7lgBuzxITwmnftKDDI6lXe4bpn7OLJRIp2cK6NJfoTT9Q53MjZYoEFya2qA81pCJCsRvtxgUWx6MvfAWwYG3yO8sgipYHrxuG87O%2Fb7qj2LyhzG7XvSNDrtbg60vZCP437IxuZUd3shQ%2BzHUdG%2FRZtL5aOmvq9XjOls9LO9%2FLNffV99GhrR2eEjYqLOYGW%2FnlL5ImPMF%2Fe52tN6PE7bXWIypTBxDoWuDEmwzsU8EwAEEubfdCL%2FwdOrmmYs4zTefZh9jvsRtf9h503Qk9lSTNiFis9sbfoq1tfHdcvBrMnVHqzD7zE89Gz%2FR4VbGtdjl0kGPWQVvgj%2FzdD%2BRzm0ZalC%2BKcr7wGUpkkT1EtccBjGnJ3r%2FATBeTv0%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqdU0uP2jAQ%2FitWKlXQzULZHqqmLIeqSL2UIMGtrCKTDIlVx7b84CGU%2FvaOkyxks6xUlRzA32O%2BGWc4B6kUFoQNIvLrHNiTAvyFIHelCELyFl0qKTwcdg4LWrZsBvOMWalf0CtLrefPAcvwa4IcpyKvHXd3Xmqk02ld4h0TKXcZkCmTxmqg5WwjNuIKF9YqE43HW4m81PkoZ7Zw2xGTY6lAlGALmTVsBxgVStWFnGEiJwIbNoqmQGphFF2VX70Kk11qyQLnIeeNIPjZM20d5eSPBwdD8kgy2FHHLRqqrmnJnSFR633BlKdEQ87wdEJBa79AUXTASaZKcpYyMFGknbCshCQtIP1tZr1i86PSr3rzYK83z%2B80A5ER6qxsBk6u817yB978YUjuZ91G%2B9OtQZevYj3437He3MT2b6SfvXIl3ptvM2z7aOhvcbxaJ%2FFyvvg5X%2F%2BIvw8UZu3YMSSDtsVEWT1F%2Bywkxmb4upvVej8MyV6ybIhlgqoKyb8uOhwhdW%2Bv%2BWWdb6y6lzMOuoY89%2FBp8tETnG1N82cTbUp9Z57aN%2FLJl4egesKzVJZJ4dXBPc7ziKUnn6%2FFqWeXVABfFfIgULaj3EAnPHb2mcKr9QzVublpwfrsdrGDpur5WFVP%2BPwF1n9%2Bqw%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1001,7 +1001,7 @@ include::example$troubleshooting/fix_registry_ambiguous_bases.cpp[tag=content] #### `boost_openmethod_registry must return a registry` -*Example* - link:https://godbolt.org/clientstate/eNplUk1v2zAM%2FSuCBhQJmiVLdyjmJTkMC7DL6gIrelkKQ5EZm6gsCfrIUgTZby%2FluLOXWgeD75GPpPSO3IP3aLTnGft95FjSfz5hXAldRVEBhVxeX3OCvIlOtsAH1FLFEtgCjQ8ORLPa6I3u4ToE67PZbGuIN66aVhjquJ2imRkLuoFQm%2FLMDoBpbW0rFD3qimnRgLdCAmsTs6zP%2FJqyqHOUgd0Z6njcaEbfHl2IQrG%2FCRyN2ZKVsBNRBSo4DYvuVfQs62r%2FY5qXwkGFFL1QQlf%2BD8qyP7TJwhqFEsFnmYs6YAOFrEE%2B%2B9WF2Ppg3bvZEngxW%2BLPS7erFv2m%2FTBLhrrf41ue%2F3oo8vv13c%2F1w4%2F8%2B8hS3Q4PEzbqGhU2uEXqtZowH0q6vvNTXY0nbG%2BwHJNOelZpGosKXOuAJwLgADLSq3WWeOMp6vzBZXLHzef5p1SvcDs0D283SMSeNMlZCZt%2FueGnpG1s6MzGP9JQS7LW%2FJafBmM8osetSjbbCeVhwOQx2Bh6nq440cJVsQEdWlE%2BBN5LUUvUb3ltcJFzeqLzCr9oEB4%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUk2P2jAQ%2FStWKlWgTaFsD1VT4FAVqZcCEnsrq8gkJhnVsS17zIdQ%2Bts7TrIbdstKTQ7JvPfmzYw9lyjTCoXCKGG%2FLhGejaA%2FAqWvVBSzt%2BjKaBXg%2BCpY8qpjc7HIAbV9QW%2BQY%2BAvEeT0mRAnuSqajLu7IHXa26yxeAcqkz4XbAraoRW8mm%2FVVvVwiWhcMh7vNPHaFqMCsPS7EeixNkJVAkudt%2BwVMCqNaYy8A1UwRQ07wzPBGmGS9MqvQUWVfYZsSfOwy1Yxeg5g0XPJ%2FgRwMGQzlos99xIpob5OWkvvWNLlvmCqc2pFARSdSdClP0NJcqRJpkZLyEC4JLFeIVQizUqR%2FXbzV2aLk7H%2F9BbAV70Fvh26GTXtJ%2B2bmTFQ%2FRzfVqvNQ7paL5Y%2FFw8%2FVt8HhvL2cIrZoCuUGrTTUGseM4c5HV97Ve%2BHMTtoyIfkE9V1zP53ccRJZP7ttXlejxurE%2BQghW2gwN1%2FmnwMhISda5dXdVWaAwjUoZVPvtxH9SPF2iBoFdTRB5pnRtaTz705D%2ByaKyE3pT4qku25dOKq%2BMrjE0W3ExhuC3czhfzhttnRcvMU1vUjvX8BFYc%2FzA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1024,7 +1024,7 @@ include::example$troubleshooting/fix_registry_not_a_registry.cpp[tag=content] #### `this class declared its registry affinity after it was first mentioned...` -*Example* - link:https://godbolt.org/clientstate/eNplUu9r2zAQ%2FVeEBsWhWbJ0H8bcJB%2FGAvvSutCyL0sxinyxxWRJ6EeaEty%2FvSfHqd3EBtv33t270%2FkdqAPnhFaOpuTfgYoC37MxoZKpMrASMKT8%2Bpoi5HSwvAW%2BCMVlKIDMhXbeAquXa7VWPVx5b1w6nW408tqWk1L4KmwmQk%2B1AVWDr3RxZAfApDKmFQpOqJIoVoMzjANpE9O0z7yNWdg5cE%2FuNXY8rBXBayesD0yStwgmI7IgBWxZkB4LmmHRgwyOpF3tJ6Z%2BzS2UAqNXTOjKP6A0fcGTzI2WggtwaWqD8qKGnFfA%2F7vlmdhqb%2BzFbBE8m23A58bbeUxZEgX7E3ncSLuHvF9DP%2BliOPfHYX9l2eNTnj2s7u9WT3%2By34nB%2Bq3Yj0ly0W1MnC9wx8f%2FeTUak50WxajViV%2BEMymTmHpFAJ%2Bj07k6zSSCnQjXwcfKZq2icbiujZBgW489IwB74AF90ZnuxGPUOZDy6L%2Bb77NvsV6KzdCetF1DJHaoid6N2OznDW2itja%2BszP9isMs0LyzH7QZjPFXOLGR0chbJh0MmCx4E3zP40%2BMNLNlqEH5VpQOgUspbCnUKa8NznKaZ7zfAbcDMws%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNU9uO2jAQ%2FRUrlVZBm4WyfaiaBR6qIvWlgMS%2BlRUyzpBYdWzLFy5C6bd3nATI7rJSEymJzzlzPDOenCKmpAPpopT8PkXuqAG%2FEBS%2BlFFCPqJLrWSAk85iRsuWzWCacafMK3rpqAv8KeIZvobICSrzOuL%2BPkit8obVFp%2B4ZMJnQEZcWWeAlpOVXMkrXDinbToYbBTyyuT9nLvCb%2FpcDZQGWYIrVNawHaBfaF0bectlTiQmbDVlQGphml6VT0GFO3vmyAzrIaeVJHjtuHGeCvI3gHGPjEkGW%2BqFw4CqG7QQ3pK0jX3FlMe1gZzj6oiCNvwCpekeKxlpJTjjYNPUeOl4CWtWAPtjJ2%2FMpgdt3uUWwDe5dfi1dmYUJBMi4XAmm47UfVhf23DNdNzN%2B1Ls9%2Fl8%2BbyeL6azX9Pnn%2FMfscb4LT8kJH63W0Ksy7DHzXne9RKyUzzr1T7hizAqRBykdwTw2TvX1XrGAWxNmPIuRFYrGVVVQv53NOEAzH88mJcBvDGcQc4FmBoK3OOX4edACL6xze8h213qLgZq18iH3x6j6gXXSjuuZFBHD1jHGK2HX6%2FmNLALKkEsC7WXKNtSYaGz%2Bdy7M4XnHxhqcnszBP35bbO9ofq8rKoXvP8BlexiuQ%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1057,7 +1057,7 @@ include::example$troubleshooting/fix_registry_declared_late_2.cpp[tag=content] #### `std::shared_ptr cannot be passed by non-const lvalue reference` -*Example* - link:https://godbolt.org/clientstate/eNqlUl1v0zAU%2FSuWkapUKw0dD2ih6wNiEi8sk5h4oVPkOrfJFY5t%2BaNsqsJv5zpL1wweSaQk95x7ju2bc%2BQevEejPS%2FYjyPHmt6rBeNK6CaKBqjk8uKCE%2BRNdHIA3qCWKtbA1mh8cCC6zVZv9RluQ7C%2ByPOdId64ZtlgaONuiSY3FnQHoTX1MzsBlq21g1H0qBumRQfeCglsaCyKc%2BfH1EUrRxnYraEVj1vN6DqgC1Eo9juB2Zxdsxr2IqpAgn4qulPRs2LUvmK6p8pBg1Q9UcMof4GK4hedZG2NQongi8JFHbCDSrYgf%2FrNyex%2FR5GjDuCMzX2oK98KB3Vlg3uZ0Key%2FHZflXc3t19v7r%2BUnzNL%2Bj0%2BLlg2do%2BjSKp1OuZmtmBkRlN8%2FmOz%2BYIdDNbzYb%2Fpi0mhVJYmM2OWnvPTVEfvLIGjiTQxJGW%2F1Ska0nQWFbghRQ8EwCPISMcdY3XiqRozxmVK2OX71bukV7ibBpAP40jEgTwpnQlbXV3yPnkbG8bA8re0mWuK5%2BoD7yfb%2BI4edypFdS%2BUhwlTxmBjOPP0zxMtXBM70GEw5VPgXytaEvWpbyj%2B6ukf6P4DLp4qhw%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU91r2zAQ%2F1eEB8Ghbrx0D2NumoexwF4WB9K3phhFVmwxWRLSKWkI3t%2B%2Bk%2BN8FFIYzAZbd78P%2BU7nQ8S0Aq4gysjLIYK94bjCpPSNihLyEdwYrUI6uQrmtOnRks9KAdq%2Bg5dAIeCHSJT4GiMmqao6xd1doDrtLessPgnFpC85mQjtwHLaTFdqpS7pGsC4LE3XGnFtq1EloPbrkdCpNlw1HGpdHtGrxKg2pjPyTqiKKPxgZyjjpCNm2YX5GFi4s2dA5lgPOawUwWsrLHgqyZ%2BQjIfkiZR8Q70EFLTXooX0jmS99h3S7AvLK4HRHgm9%2FJzKsh1WMjFaCia4yzLrFYiGF6zm7Lebnsz%2BtxWpwHO12qQOysLV1PKyMGDPHfqe58vnIl%2FM5r9mzz%2FzH7FB%2FUa8JSTu2X0rgmoSypwOEoJm2MXjiQ2GCdlqUQ677w0rwqiUcejMgBh8Dk9d7b3jkOxNmPYQlO1KRW2bkH8dPv7Gmf949M4jdmP8Al1IbrtUwB6%2BjD8HQIq1O%2F4Aqt%2Bl62aAtkf6%2BNtD1L5irA0IrQI7usc6ntB6%2FPViTgO6oIrLZa13CmkbKh2%2F2jz3cIJwXAJCbeVuStBf3DbbWWpOYdu%2B4v0XxRtaNQ%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1091,7 +1091,7 @@ include::example$troubleshooting/fix_shared_ptr_by_reference_2.cpp[tag=content] #### `cast only allowed to a shared_ptr` -*Example* - link:https://godbolt.org/clientstate/eNqlU8tu2zAQ%2FBWCBQwbdq06PRRlFB2KGGgPjYI0yKUKBJqiJaIUSfDhJjCcb%2B9SlmLV6a3SQdiZ3Vlyd7THjjsntHKYoJ97LCr4rhYIS6rqQGsOIWbzOQbI6WBZB7wTislQcZQK7bzltM0KVagT3HhvHEmSjQZe23pZC9%2BEzVLoRBuuWu4bXR3ZEbBsjOmEghOqRoq23BnKOOoSCTllXsYs6ByYRzcaOu4LheDZCesDleglgtMZukIV39IgPRQcxkW3MjhE%2Btq%2FmPa5tLwWED1DQl%2F%2BChHyG26SGi0FE9wRYoPyouUlazj75bJB7H9HkQjludUmcb4qXUMtr0rj7euEvuT5j%2Fsyv13ffF%2Fff82vp8f7G1DZiqcFmvaTKFMGu%2FUIZAg56aTx4tkkWxyJfomT2QLttKhml%2F9qUeYP67u7b9frN73OxeNwswky8DlrgLQbegwr0w6lKSrwvMBxSYWKVmO6NUJy27nyEQD%2BxFmA8fU2HXiIes9iFh178XH1IdZLsRkbGnfjjcQONMHtEVt9vsCHqK2N738A%2FB5OewV2X33Ch9ExHoQTGxmtv6XS8RGTB2%2BCP%2FHgoUhTW4eWK9%2BJ4jHwVgpaCjXkdcFZzuER3j%2FxykHZ[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU11vmzAU%2FSsWk6JEYWHpHqa5lIepkbaHhaip9jIq5IAD1oxt%2BSNpFLHfvmtCPtql0qTBA%2Ficc8%2FlfrAPCiksFTbA6Oc%2BsDtF4Q1A7hoRhOgtulFSeDi8OMxJ07MlnZXMSv2CXlpiPb8PWAmPKXCciKqLGI%2B91Eini87iHRMFdyVFMZPGakqaJBOZOMO1tcrgKFpJ4KWuJhWztVtNmIykoqKhtpblgb0AJrVSnZEzTFRIwAcbRQqKOiHGZ%2BWtV0FmV1g0h3rQPhMIrg3T1hGOfntwOEJ3qKRr4riFgPYyaMGdQbiPfcE0u1zTisFpB4I%2B%2FARhvIVKYiU5Kxg1GGsnLGtoXtS0%2BGWSo9n%2FtiJiMFctVWRsmZuaaFrmyupTh76k6fIxTxez%2BffZ49f0fnioX4HLmj2HaNh3Io9hQ4xFYIPx2Sf2hSeDJDwQ%2FRAHoxBtJCtHt9dS5OmP2cPDt%2FvZX7lem%2FvmJgOk4PEqAZLmmOM4MmlQHKMsGGeBH1ImgrYN0b8uM32mhXt7lU8re2WdvZxxqjvIczcfpx88wdnKHH4o0WfppuOpzUE%2B%2FXwTtE9wlsoy6K%2FH3kOhd2A9%2FXQ2J55dEEH5spZbAbI14YZeJE%2BdPVKwfp4hujJXQ8CfXTfbaqKOx7Z9gvsPutRxhw%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1116,7 +1116,7 @@ include::example$troubleshooting/fix_shared_ptr_overrider.cpp[tag=content] #### `a std::weak_ptr cannot be wrapped in a virtual_ptr; use weak_virtual_ptr` -*Example* - link:https://godbolt.org/clientstate/eNqlUstu2zAQ%2FBWCvThIa9XpISjj%2BBPSnnqpA4Om1tIiFEmQS7uB4X57l4wcK2lvlQAJOzP74HKOMkFK6F2SSvw8Smz5v%2FgopNWuy7oDDqW5vpYMJZ%2BjqcAHdMbmFsQSfaIIelit3dpd4J4oJNU0W8%2B8j928Q%2Brzdo6%2B8QHcANT79oWdAPM%2BhFooJ3SdcHqAFLQBUYVKXZR3RcWdsyHx4Lnjce0EP3uMlLUVvws4uxL3ooWdzpY44TRN%2Bm5zEmrMfcMMz5sIHXL0zIIx%2FRVS6sAnWQZv0SAkpWJ2hANsTA%2FmKa3Oxf53FQ06guhDk6jdHEA%2FbQLF1%2F3sPbbioMn0M%2BZ5plGwLOdZCcffq3crqfQ%2FxCsRZlVfNrR25Z6NHwJaiNUSjwzALzCZZx89cuY5Gg0jTbHLzZfF55JvcTt1k6xnK8Sea7LVCrb4eiNPpbYPNLpPfuLx7tlri1t5mozxAxNubfHdTtsEE%2BZbppDpwvMFFlrHLg%2FgqBaVU%2BDvUtwS3VlXg3ea0yO%2FfwBPARnT[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlkk1v2zAMhv%2BK4F1SNIuX7jBMS3PbtSvQ41IEiszaQmVKkKh4QeD99lGO89EhBQbMBiyTz0tKpLgvtEMCpEKKn%2FuCdh74j502tVhMxXu49Q6ze3phPKh2pBV8rwy58AY%2FkaLM94WpeJkzswrrIeL2NkujS0EPKT4Y1DZVIBbGRQqg2uUKV3h2N0Q%2ByrLcOOYu1LPaUJM2M%2BNK5wFboMZVB3rhmDXeD4lSNFgL5ANHrzSIQSjlWfktq3jnpEk8cD1iv0LBz9YESsqK39k5uRH3ooIXlSxxQH8Z9GhTFHKMfUPa3TpAbdjasWAMP7mk7LiShXfWaANRypCQTAtr3YB%2Bjctjsv9tRWn4XoPzZaRq3YF6XXsKp%2F5snalEp0g3E%2BZ8plGwyPUsBfL35q%2BWDPiKeCn8ZNDnDq2w6Pup%2BNdJgl%2Bg0%2FtzdJqXK7OU5cZCGFyZ3X2ef8rAmk08TDOOuwytyWh7kM%2B%2F3hX9M9vOk3GY1cVHruyeU8%2B%2FnJOrTB8Vgn1qXIcse1E2wsXmPxIdEd99JirU8WoI5zfXk3VB%2BaPZ98%2F8%2FgGEBkmB[Compiler Explorer^] [source,c++] ---- @@ -1141,7 +1141,7 @@ include::example$troubleshooting/fix_weak_ptr_in_virtual_ptr.cpp[tag=content] #### `a weak pointer cannot be a virtual parameter; call lock() first` -*Example* - link:https://godbolt.org/clientstate/eNqlUstu2zAQ%2FBWCBQIZca06PRRVHR2KBuilcYAGvdSBQFNriQhFEnw4CQz127Nk6Fh93CodqJ2d2V2u5kAdOCe0crQiPw9UtHgu54RKprrAOsCQ8vNzipDTwfIEvBGKy9ACWQntvAU21Bu1USe49964qiy3GvPadotO%2BD5sF0KX2oAawPe6fclOgEVvTCoUnFAdUWwAZxgHkohVdWJ%2BiizsHLgn1xo7HjaK4LMX1gcmya8IFjNySVrYsSA9Csap6EYGR6qs%2FS0zPDUWOoHRExKy%2FBWqqge8ycpoKbgAV1U2KC8GaHgP%2FN7Vx2L%2Fu4pSKA9Wm9L5tnkAdt8Yb1%2F383m9%2Fn7brG%2Burr9d3X5dfykMqnficU6KvIFmhUIcNitX8aJ1PScJzf%2FsbDYney3aWZo4fhHOpCw4usG%2FMF3PLLSpQtxYfUYMHrPjunPb4h%2B9ikTMDbkOPnYZNyoaievBCAk2ee4OAXgEHnA52YTHPEbZkZRHP168X76Leim2U7vStLyY2GNN9HLElh8v6Bhra%2BOzvelbHOYSzbz8QMfJGD%2BEE1sZjb1j0sEksw7eBH%2FKo0NimtkuDKB8KkqnwN%2BlsKVQR14K%2FuCMd%2Fg%2BA1jjOxU%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU0uL2zAQ%2FivChcVh3bjZHkrdrA%2BlgV4aB7K3ZjGKrNhiZUlIo2RDcH97R47zWMhCofbBmu8xI43Gh4hpBVxBlJHfhwj2huMKQelbFSXkPbo1WgU4uQrmtB3Yis8qAdq%2BoZdAIfCHSFT4mSAnqap7x%2F19kDrtLetTfBCKSV9xMhXageW0zVdqpS5wA2BclqZrjby29bgW0Pj1WOhUG65aDo2ujuwVMG6M6RN5J1RNFG7YGco46YVZdlF%2BCyqs7BmQOZ6HHFaK4LMVFjyV5E8A4xF5JBXfUC8BDd21aSG9I9ngfcO0%2B9LyWmC0R8FgP0NZtsOTTI2Wggnussx6BaLlJWs4e3H5Kdn%2FtiIVeK9Wm9RBVe44fSkN2HN%2FvhfF8qksFrP5r9nTz%2BJHbNC9Ea8JiYcOlFM04mYH5zQcNM8T0qPDnd2NErLVohr1Ow4rwqiUMc6Ug6PSNdTyqs8QOpbfEYOf0andQ9n4Rq24Fw4FmfYQqnQrFXVdQv51VPkrZ%2F79QT0P5I1hDXIhue2hwD18nnwKhBRrd%2Fxd1FCl732gtkf55OtD1D1jrA0I7EXAPuI5HjH15MslOQ3sgioul43eKZRtqHT8qnjh4UThcAWG2trdtGB%2BcTvZzlJzCrvuGd%2B%2FqfVqww%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1169,7 +1169,7 @@ xref:interop_type_erasure.adoc[Interoperation with Boost.TypeErasure]. #### `requires standard RTTI` -*Example* - link:https://godbolt.org/clientstate/eNqlU02P2jAQ%2FSuWK61Am0LZHqq6LIeqK%2FXSZaWueimryDgmjOrYlj%2FoIpT%2B9h0HB1J6qpYciN%2BbeTMZzztQL70Hoz1l5OeBQoX%2Fs4JQxXUdeS3xSMX1NUXIm%2BhEB7wBLVSsJJmD8cFJ3ixWeqXP8DYE69l0ujbIG1dPagjbuJ6AmRordSPD1lRHdgBMttZ2QtGDronmjfSWC0m6QMbOkZ9SFFaOIpB7gxUPK03wtwMXIlfkTwJHY3JLKrnhUQVMaIdJDyp6wnLuX0yzL52sAU97DMjpJ4ix3%2Fglc2sUCJCeMRd1gEaWYivFL7%2FoxV47imlfYeoDDyBKFwLk%2BbxaG3SQzliUrkqu96ex5wn0Ff9jCoMmTyP4vFx%2BfyyXD3f33%2B4evy6%2FjI5XZLGZDTwXZJQvq5wLXL9UtmIM27laFMf3vFpX44LsDFTFZWPjrkyiiOBKjS5kiMbLHfebkcuOEpj1hYkhabQrndZbmMaCkq5zwhMC8lmKiGPN1uh5PGWfUJFccvN%2B9i7lK1gPTUS7sSdih5rosITNPt7QNmkbG7Lp6Fts5hYtNvtA20EbP8DDWiW7bbjycsAsY7AxnHm8tURzV8dG6tCJ0iHwrxSWBN3HdYeLmPYJnxeNwXRS[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU02P2jAQ%2FStWKq1Am0LZHqq6LIeqSL0UkNjbsoqMY5JRHdvyByxC6W%2FvOCTArlip1SaHxO%2FNvBnPxyHhWnmhfELJ4yHxeyPwD0EZKpWk5C26MlpFOL04zFjVsrmY5uC1fUEvPfORPySQ42eEnGSqaDxub6Op08HyRuIDKC5DLsgYtPNWsGqyUit1hkvvjaPD4Vojr20xKMCXYT0APdRGqEr4UudH9gIYlMY0QsGBKojChJ1hXJDGkNKz5bdohZED92SG9yGHlSL4bMH6wCT5E8Fen9yTXGxYkB4d6kunhQyO0Nb3BVPtMysKwNMeDVr3E0TpDm8yNloCB%2BEotUF5qETGS8F%2Fu0kn9t5SDLsIQ4d9AZ5Z76Gtz7u1AWfGaoPSecbU%2FlT2tgJdxP%2BowkWSpxJ8n8%2BXD9l8MZ39mj78nP%2FoHVtkMJkNPKek1zYrG%2BMQuxg2pxTTuZmkx%2F92tG76KdlqyNPXifWbMJEinEnZeyVDFDa3301GG7YXwVaf6%2BCjRr1SSV2n5F8XSDwLHt5en9OaXFmhaA5S2AaK3N3n0adISFi74xKrNkrTtUhtj%2Bajr3dJ%2FYRnbTzgTSP2Ee9xj9KjL2dxFtkFU0IuS71TaLZh0omL4PPgOwobHhlmC3fVBfXhutjOMtMd6%2FoJ37%2FrPqQA[Compiler Explorer^] [source,c++] ---- @@ -1195,7 +1195,7 @@ include::example$troubleshooting/fix_any_custom_rtti.cpp[tag=content] #### `virtual_any must be passed by reference` -*Example* - link:https://godbolt.org/clientstate/eNqlUl1v0zAU%2FSuWkaZUKw0dD4hs3QNiEi8sk5h4oVPkOrfJFY5t%2BaOsqsJv5zpN1zAeSaQkPufcc%2B2bc%2BAevEejPS%2FYjwPHmt7LOeNK6CaKBmjJ5eUlJ8ib6OQAvEEtVayB3aDxwYHobtd6rc9wG4L1RZ5vDPHGNYsGQxs3CzS5saA7CK2pj%2BwEWLTWDkbRo26YFh14KySwQVgUZ%2BV1UlHnKAO7N9TxsNaMrh26EIVivxOYzdiK1bAVUQUq6KdFDyp6Voy1fzHdvnLQIK32JBjLX6Ci%2BEUnubFGoUTwReGiDthBJVuQP%2F3tyex%2FR5GjDuCMzX2oK6H3L6P5VJbfHqvy4e7%2B693jl%2FJzZqlwi89zlo2Hr8aSOaMPGtrxB13M5mxnsJ4N20tfTAqlsjSIC2bpOXs1xJMP02lIq0FzfVSMPbPEjG2kiSF592udsiJNZ1GBG2L1RAA8g4x0%2FjFnJ55WY%2Bi4TJG7er98l%2BoVbqaJ5MN8ErEjT4prwpYfr3ifvI0NY4L5W9rMivK6%2FMD7yTa%2Bo8eNStndCuVhwpQx2BjOPIUg0cI1sQMdBlM%2BBf61opaoT7ph8UrTP9H9B%2F7vMAk%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU91r2zAQ%2F1eEB8WhXrx0D2Nu04exwF4WB9K3phhFVmwx%2BST0kTQE72%2FfyXY%2BOlIYzAZbd7%2BPs07nQ8QUOA4uysjzIXJ7zXGFSekbiBLyHtxoBSGdXARz2gxoyWelcMq8gZeOuoAfIlHia4KYpFB1itvbQLXKG9ZZfBDApC85eRDKOsNp87iCFZzTtXPaZmm6VogrU40r4Wq%2FHguVKs2h4a5WZY9eJMa11p2RtwIqAvjBVlPGSUfMsjPzPrCwsmeOzHE%2F5LACgtdWGOepJL9DMh6RKSn5hnrpUNBeihbSW5IN2jdIsy8MrwRGeyQM8lMqy3a4kwetpGCC2ywzHpxoeMFqzn7Zx6PZ%2F7YiFXiuRunUurKgsD%2B15lueL5%2BKfDGb%2F5w9%2Fci%2FxxqFG%2FGakHjYfDFIEoILbFp%2FQDejhGyVKEfd54UVYVTKODTihmh8jv5q4tGHQGjStOPc94yhZhyQoQxT3gXvdgVR2ybkX6eRv3Lm35%2FF08xdmcdAF5KbLhWwu8%2BTTwGQYm37PwKGKl17A7Tt6ZOvd1H7grHSTigI7Ogj7mOK1pMvZ3Ma0AUFLpe12gHSNlRaflE89%2B4I4fwEhJrKXpWgv7hutjNUH8O2fcH7D7M3X7c%3D[Compiler Explorer^] [source,c++] ---- @@ -1227,7 +1227,7 @@ include::example$troubleshooting/fix_method_takes_virtual_any_by_value_2.cpp[tag #### `an owning type_erasure::any must be passed by reference` -*Example* - link:https://godbolt.org/clientstate/eNqdU02L2zAQ%2FStChSVh06TZHkq1Tg6lC710s9Cll2YxijxxRGVJ6CNNWNLf3pGtxO7updQBO3rvzRtpRvNMPXgvjfaUkR%2FPVFb4nU8IVVzXkdeASyqurylC3kQnWuCN1ELFCkghjQ8OeLNc67Xu4V0I1rPZbGOQN66e1jLs4mYqzcxY0A2Enak6dgBMd9a2RtFLXRPNG%2FCWCyCtkLFeeZtUmDmKQO4NZnxea4LPXroQuSK%2FEzgakwWpYMujChhwGgY9qOgJy7F%2FMc2xdFBLXB1RkMMvEGO%2F8CSFNUoKCZ4xF3WQDZRiB%2BKnX57N%2BlJ0h2ysmu1BYC3yIV8KwtFCCY776GDG9fFfZJsoVZD6lfT%2Fqj%2BTOoAztiPKYaZLY%2FqWBMDi5r4Mpbd9%2F%2FAUpU4FXnTNCcAYYkWOwpIw1tWkSJQw9lgKk%2FsgNwqK5aQNcqD4AarlsjX%2FtFp9eyxXD3f3X%2B8ev6w%2BjyzabeVhQka5%2FWVxTo0GPlR4c7pbejWekL2R1bg1Sv%2BI4EqN2qyX%2FV6R9B6f71S2HyUw2wkTQ%2FI4rXUaDGEaKxW4doaeEIADiIjnykN15nGVJ4yKNF837%2BfvUrySm%2BH40bZAidijJ85mwuYfb%2BgpeRsb8rjSt7iZBQ7n%2FAM9DbbxXfpUPVRsufIwYFYx2Bh6HiudaO7q2IAOrSkdAq%2BtMKXUZ127eKE5PeHvD0CtiPc%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqdU9uO2jAQ%2FRUrlVagpVC2D1W9wENVpL4UkNi3ZRUZZ0isOrblCxeh9Ns7TsJlW1ZaFSSIzzlzJnPxMeFaeVA%2BoeT5mPiDAXxCUIZSJT3yFl0arSLcuzrMWNmyGUwz4bV9RS8985E%2FJiLDvyFykqm8jri%2Fj1Kng%2BW1xQehuAwZkJHQzltg5WSlVuoCF94bRweDtUZe27yfC1%2BEdV%2FogTagSvCFzhr2CugXxtRGwQmVE4Uv7AzjQGohpRflY1Rh5sA9mWE95LhSBD9bYX1gkvyOYKdLxiSDDQvSY0B1HbSQwRHaxr5iykNqIRd4OqCgDT9DlO6wkpHRUnABjlIblBclpLwA%2FstNTmaXVjRFlkYOtsCxF22Rfwvi7FKwzAULA6YO75Gtg5BeqH%2Bk%2F9f9gcBVsto0RHqd6TyYy0g8YHPbuVxLHy%2FzwypSFRs8bobjgVLERm0UtoTSpiejSHFtDinuczMHsZYwmvTqIAuS7SGbTGrzb%2FP58imdL6azn9OnH%2FPvHYN2G7HvkU47%2FnR0So0Gzme4Oc2W3nV7ZKtF1q2N4hPhTMpOnfX8vnck%2FnZPO9XadyLY2nEdfPSoViqpqh5579WDPfDw9sU7X7Ably%2FKhQRbQ5F7%2BDz8FAkp1q65%2FqrNUvc3UttGPvz6kFQveNbGC6w0Yh%2BxjjFaD79czFlkF0yBXBZ6p1C2YdLBVfJ58CcKhxQZZnN3MwT9xW2znWXmdKyqF%2Fz%2BAZUjuKU%3D[Compiler Explorer^] [source,c++] ---- @@ -1259,7 +1259,7 @@ include::example$troubleshooting/fix_method_takes_erased_by_value_2.cpp[tag=cont #### `do not wrap a virtual_any in a virtual_ptr...` -*Example* - link:https://godbolt.org/clientstate/eNqlUk1PwzAM%2FStRkNAmYGVwQIRtPwE4cWGoylLTWqRJlI%2FBNI3fjlM6VsaR5lD5vWc7dt6WBwgBrQlcsOctx4r%2B03PGtTR1kjVQyNXZGSco2ORVB5ygUTpVwGZoQ%2FQg28XSLM0BbmJ0QRTFyhJvfT2pMTZpNUFbWAemhdjY6psdAJPGua5QCmhqZmQLwUkFrBMKcVDeZRV1Tiqye0sdt0vD6Fujj0lq9pnB0ZjNWQWvMulICbth0qNOgYk%2B9xfTbkoPNVK0IUGf%2FgMJ8U6TzJzVqBCCED6ZiC2UqgH1Fhb7Yv9dRYEmgreuCLEqpdn8rGZtsWLOEz3qhy17ySkzNM34aBWli352pFwwN%2Bq0eStLk99W2dahBt%2FZ4IUA%2BACV6L69L%2FY8Rb1JuMoWubqeXuZ8jauhg3g3TybWVJPslbHp7RXf5drWxd5x%2FIKuNCd%2FTW%2F4bnCNJwy40tlrr1IHGDAPKboUDzw9Wqalr1MLJnZF%2BRD4W4paotnruuBIs3uh8wXKgBZy[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlkk1v2zAMhv%2BK4AFDimZx0x2Kqmluu7YFelwKQ7FZW5hMCRKVLAi83z7KcT5apECB2geb7%2FOSMmlus9IiAVImxe9tRhsH%2FMaiiS1mY%2FERbp3FJI9PggfVDrSCX5Um69%2FgZ1KU%2BDbTFT%2BmzIzCus%2B4vEzWYKMv%2BxLfNJYmViBm2gbyoNr5Ahd4lBsiF2SeLy1z6%2BtJramJy4m2uXWALVBjqx09ESaNc32hGDTWAvmDg1MliN4o5dF5l1x8cixJPHA%2FYrtAwddKe4rKiH9JHF2Ie1HBq4qGOKE7TXoyMQg55L4h7abwUGuONmwY0g%2BSlGvuZOas0aWGIKWPSLqFomyg%2FBPm%2B2JfHUWu%2Bb966%2FJAVaFwcxjNyupKOM94NDRbDJbvArmbi3ejKBz52TvnXLhR701TWWDWdWPx2e2Bv1DGj3fnsCNn9ifZtQHfS4ld%2F5xeJWD0Muw2GIdT%2BnEktNrZp7fXWffCsXWkLSZ39oO7uefS05tjcZXok0Iwz41dI9telQlwcvhjpD3i%2F52I8nU4m8L19flia6%2FcPuy6F77%2FA%2BPVRiA%3D[Compiler Explorer^] [source,c++] ---- @@ -1282,7 +1282,7 @@ include::example$troubleshooting/fix_wrap_virtual_any.cpp[tag=content] #### `use of deleted function ... final_virtual_ptr` -*Example* - link:https://godbolt.org/clientstate/eNqlUttO4zAQ%2FRXLK62KWBrKPqzWXD4BeOKFosh1pslonbHlS6GqyrczDinNwiPxQzTnzJwZj89ORogRHUWpxONOYsP%2FxS8hraY26xY4lOb0VDIUXQ5mAH4gGZsbEFfoYgqg%2B5slLekIdyn5qKpq5Zh3oZ23mLq8mqOrnAfqIXWueWcnwLzzfhDKEakVpHuIXhsQQ6JSx8zLksWds0ni1nHH3ZIEfxsMKWsrXgs4OxHXooG1zjZxwX5adG9zFGqs%2FY%2Fpt3WAFjnacsJY%2FgEp9cw3ufLOokGISoVMCXuoTQfmX7w5iH13FRVSguB8FVNTa9p%2BrGbjsBE%2BMD1jSinmfgria5wcdrBG0rYeN1H7FGYDXTawpPKOxvUeLYThyZ8YgBcwmWcbPXDgORoNIU2xw8XvxXmpt7iaukUOsxdiw5pspYIt%2Fl7IfdF2Po3ukmc88DV7afFH7idjPGDElS2%2BWmsbYcLc5eRzOvL8QIXWoc09UBpE5RT4KsUtkQ55Q%2FApZ%2F%2FE5w0Y8w4o[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlkk1v2zAMhv%2BK4AFDimbx0h2KqR%2B3XbsCPS6FociKTUymBIlKFgTebx%2FlOB8FUmBA7YPN93lJmTR3hXZIBqmQ4teuoK03%2FMaiTR0WU%2FEe7rzDLE%2FPgifVjbQ2P2ogF97gF1KU%2Ba6Amh9zZlZhM2RcX2drdCnoocQnQG1TbcQ9uEjBqO5xgQs8yS2Rj7Isl465C82sAWrTcgaudN5gZ6h19Z6eCbPW%2B6FQioCNQP7g6JU2YjBKeXLeZRefnDSJJ%2B5H7BYo%2BFpDoKSs%2BJvFyZV4ELVZqWSJE%2FrzpGebopBj7hvSbatgGuBoy4Yx%2FShJueFO7r2zoMFEKUNCgs5UujX6d3w8FPvoKErg%2FxqcLyPVlcLtcTRrB7XwgfGEkZTMPgvkNq4OM1gBKluNk6g8hcmA8wQWWPT9VPzvppg%2FRqf39%2BS4Dxd2JdvBmjBImd18m3%2FNwMIy7rcVx1OG1jNa7%2B3z7zdF%2F8qx8wQOs7v4wr0%2BcOn57am4yvRZobEvrdsg21bKRnN2%2BM9EB8T%2FNhMVmngxhevD5WKboPwh7PtXvv8BNIQ91g%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1310,7 +1310,7 @@ include::example$troubleshooting/fix_final_virtual_ptr_any.cpp[tag=content] #### `no matching function for call to ...cast` -*Example* - link:https://godbolt.org/clientstate/eNqlUtFu2yAU%2FRXEpChRsmTpHqZSNw9TI20Pq6uu6ktdWQQT%2B2oYkIGsUZR9%2By6O3Xjd3mYerHvOvQc4nAN10jkw2lFGng4UCvwvZ4QqrsvAS4klFdMpRciZ0IgWeAdaqFBIkoBxvpG8XmU602e48t46tlhsDPKmKecl%2BCps5mAWxkpdS1%2BZ4sQOgHllbSsUHOiSaF5LZ7mQpG1k7Nx5Fbtw5yA8uTW44yHTBL8dND5wRX5FcDwh16SQWx6Ux4HjcOhOBUdYN%2FsHU%2B%2FzRpaA1R4buvFXiLGfeJPEGgUCpGOsCdpDLXNRSfHDrXqx%2F7ViAdrLxtgTkXO9fzXnc5p%2Bf8jTu%2FXtt%2FXDl%2FRmbLFjCy8zMu6unycCH9T3tuHwaDUjzhdo4em5RpMZ2RkoJlf%2FUszTx%2FX9%2Fdeb9UA6GjZ6I0KM63X6BzCOJAnJ6DSj0fJMx%2BAIU1tQsmkz9oyAfJEioBld6Hoeqy6BVMT8XXxcfojzCjbDeNL2XpHYoSZmN2LLywt6jNrG%2Bi7O9D2e9hrDu%2FxEj4NjPIKDjYpB3nLl5IBJg7fBn3lMRKR5U4Zaat%2BK0iHwtxRuCbrva4s3PcdnXL8BcV8w7A%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU11vmzAU%2FSsWk6JEYcnSPUylNA9TkbaHhaip9lIq5IAD1oxt%2BSNpFLHfvms%2BEjql0qTBA9xzzj3Gx5eTlwluCDdegJ5PnjlKAm8AMltxz0fv0ZUU3MH%2BoFjhqmNzEuXUCPWG3hhsHH%2FyaA6PBXAM86LpmE6dVAurssbiA%2BUZszlBIRXaKIKrZcITfoFLY6QO5vOtAF6oYlZQU9rtjIq5kIRXxJQib9kBMCulbIysprxAHD5YS5wR1AiD4KK8cypY2WYGrWA%2F6JRwBNeeKmMxQ78dOJ6ge5STHbbMQEM9bFozq1HQ9b5hqmOqSEGhOoKgaz9DQXCAnYRSMJpRooNAWW5oRdKsJNkvvezN%2FjeKOYVzVUK2RIr58RzO1zjePKXxOlr9iJ6%2BxQ9jCYodffXRuNt%2BGsJYaNPHBs2jpY%2B0ySHC9rhGEx%2FtBc0nd9cc0%2Fhn9Pj4%2FSEaWLvARn%2BZIKF7n%2F4AhEZhiBJvmngu8oR7de2jfx1N8koy%2B%2F5gngfwynA6OWVENZDjbj4vPjmC0a1ufw%2FerdLE4qh9K1%2Fc3nj1C9RCGgrBOewjbPQerBdfLubYsWvMCduU4sBBtsNMk8HisTU9BcPkGKwKfbUF%2FOl1s4PCsi%2Fr%2BgXuP%2B6nYJo%3D[Compiler Explorer^] [source,c++] ---- @@ -1340,7 +1340,7 @@ See xref:registries_and_policies.adoc[Registries and Policies]. #### `+the `state` of a policy that defines `initialize` must be copyable...+` -*Example* - link:https://godbolt.org/clientstate/eNqlVMGO0zAQ%2FRUrSKtWW1K6HBDZbiRYKnGAzYquuNBV5TpuOsKxQzwuW6rw7YzdtAmFAxLtoZ03b96Mn8beR1ZaC0bbKGFf9hHk9DsZsUhxXTheSAojcXkZEWSNq0UAnoEWyuWSTdFVSqYLvdAdBsZiLXl5Bm8QK5uMxytDeVMXcQG4casYzNhUUpcSNyY%2FZHtAvKmqIOQs6IJpXkpbcSFZICZJx7z2LOrsBLI7Qx33C83os4UaHVfspwcHQ3bDcrnmTiEVNP2ie%2BUsS9ra3zLlblnLAijaEaEtP0FJ8p1OMq2MAgHSJkntNEIpl2IjxVebHsU6K0pZmnqX%2Fr87Y9CAwBX8kCej2pkFp%2FbLMNTuaMXBQ8FRFtSfnOiTwoyehbKsFHGmQnFr2af2mOkh28qv9VG0B1qksj5%2ByOVJ4jR8c9QJ6yloTFnOkV93vObU%2FC8D3BqN8glHLIRxHLOsQr%2ByaX8AjiDY1kDOOk8Gglh4FLgghRCHicLmTlslEk0vhv3Jm8Pf5nxJgmP5P6xD39rTCrzNsvnDMruf3X2cPbzP3i1vP7yZz2fzgV%2B6UdjA0XmLYag8nWxwGrM75%2FSsJB34IjqCv7bClBUoWYcb%2FkiAfJLC0Y61V%2F6Yp6i9%2F5Hwt%2F%2Fq5eSFr1ew6j8OUdhBn9iSJpnnscnrq6jx2ubgp8eek8039HRMXkVNb4zPYGGl%2FDOy5srKXiZzWDns8mS4T%2FO6cKXUGESjPvCnFLUEfeSF4IzTPNL3Fx4ntPk%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlVN9v2jAQ%2FlesTKpAZTC6h2kpjbR1SHvYCBp9GxUyjgnWHDuLz1CGsr99ZyckKaJSpZEHcvd9990PX3wMmFbAFQQh%2BXkM4JBzfEOntJkKBuQlOMu1cu5Bx5jRrEYTPk0E6OIZvAAKDj8GIsG%2FMWKSqtRHXF87qtG2YF7ijVBM2oSTCdhc8miplqr1CW2g4DQ7c28BchOORmuNuC7SYSpga9dDoUc65yrjsNVJhXYcw22eeyFrhEqJwiZMThknnhiGLfPWsTCzZUBm2CM5LhXB304UYKkkf52z1yd3JOEbaiVgQNkNmktrSFjHPkOyw6rgqUDrgIQ6vHGF4R47meRaCia4CcPCKhAZX7EtZ79MdBJrR5HxTBeH6P%2BnMxJKgKBS%2FOHNoOqaGcX0K1%2FU4TSKaoYMDzrF%2FDiJLsnX6FjAs1wiZ8IkNYb8qNuMKrSW36iTaMdp3A51%2FRWWhKFV4rfFTFBMhIKIJBTobcsrm%2BQXCrh3O%2F4EA%2BLN4XBI4hyEVibqFkBBMLLTIiHtTHr4eRg4CVyhgrd9RX5zJ7USikZX%2FW7lZfVani%2BJn1jyinXojrZZgc9xvHhYxfPp7Pv04Wv8ZXX%2F7dNiMV303NIN%2FAYOzlP0fWTTWa8ps%2B1zchYS9VwQthCU5YC89mLgT5zZl6%2BF5vO%2FcDU4upC88C6H3bwfv3OAFGtTXU6qzuJX2EG7ij7%2BeBOUj2jr6iic7y2e0B1Kjz%2B04tShc6q4XGz1XiFtQ6XhneSxhROEZ%2BUQWqTmYgjqi8ti%2B4LmJ7MsH%2FH5Bx535Kc%3D[Compiler Explorer^] [source,c++] ---- @@ -1373,7 +1373,7 @@ include::example$troubleshooting/fix_policy_state_not_copyable_2.cpp[tag=content #### `+the `state` of a policy that defines `initialize` must be nothrow move-assignable...+` -*Example* - link:https://godbolt.org/clientstate/eNqlVF1v0zAU%2FStWkKaOdSkdD4jQRoJRiQdYJjrxQqfKddzEwrEjf4x1VfjtXDtuk2YCIZE%2BNPfce879iH33kaZaMyl0lKDv%2B4jl8D8do4hjUVhcUDAjcnERAaSlVcQDL5gg3OYUzYytOU1XYiU6jEltFMXVAC6NqXUymWwk%2BKUq4oKZ0m5iJieypqKippR56%2B0BcVnXXshqJgokcEV1jQlFPjBJush3LgoyW2LQjYSM%2B5VA8DwwZSzm6JcDR%2BdojnK6xZYbIDR90i23GiWBe%2BKpdmtFCwbWDgIC%2FQglyU%2FoZFZLzgijOkmUFYZVdE1KSn7o9CD2v6OYMMEMw5w90eNUQoEEQ661r2B36LsdGMGGFhLqnp8E%2BYJclKFVzSFmRjjWGn0NPaWtN8hvxUG0B2oDtD7e%2BgAcDPm5n8B5CwJnf47F1kgE7SsMM5oPSJdpeD2h%2F1WgjT%2FhDqp3j6LGKoFempLpQUFNZzYnyQZDvJbC0EczRt6M4xhltXF3LO0PERtG0INkOeq%2Ba2gyCJyBQmg6TxJ%2F1WZBCURT6KRXfyiuGZ5q%2F9Xzfzi%2F%2FeNxPLMfsmx5t85uFzdfFnefso%2Fr68%2Fvl8vFcuRuydhfmfEwxblnHjsbHcvs%2BpwNKOnIkaAFt2eIrGrGqfIr6R4A%2BkgJfEoVdtTBD1ZYWBFx6%2Brq9fSV43O26W%2BzyN8j53gATRiew6Zvr6LGact2ng67hDHPYddN30RNr4xvTLMNd3tvi7mmPU9mTW1N54eBOzdWha2oMF406gPPpSAlE4c4bwximnv4%2FQZcTeOv[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlVF1v0zAU%2FStWkKaOdS0dD4jQRoJRiQdYJ7o3NlWe4yUWjh3Z19tKFX47147bpmFDk0geknvPucf3w%2FYmYVoBV5Ck5McmgXXN8Q%2Bd0lUqGZLn4KrWyruHHeOCVhHN%2BTwXoM0BvAQKHt8kIsfPBDFJVREiTk481WpnWJB4JRSTLudkCq6WPLtW12rvE9qC4bTquUuA2qbj8a1GXJtiVAgo3e1I6LGuuao4lDpv0Y5jVNZ1EHJWqIIoLMLWlHESiGm6Z37wLFzZMSAXWCPZXCuCz70w4Kgkv71zcExmJOd31EnAgKYbdCmdJWmMPUCq9crwQqC1RkIM37nS9AErmdZaCia4TVPjFIiKr1jJ2U%2BbbcX%2BtxVjoQQIKsUvvutKTJBRXGsVMlhv624bxnCqhca8ZwekkJBnAa9qiZwpk9Ra8j3WlLVolL9TW9GO0%2FoN0%2FW3GDp7Tf4bx11ro8DR81zqQBMs31Ds0awXdJrF34Pwfwq0%2FIPYXvb%2BMRycUeQ1lML2Emr2ZnOwWK%2BJ5%2F5QPsKQBHM0GpFFDQLTz7pNpCAYudciJ%2Fu5xiKjwBEqxKLzNA1HbRqVUDTDSjr5x%2BSa%2Fq4OU89fsH%2B722O3Zz8tFsur1eJyfvFtfvVl8Xl1%2FvXjcjlfDvwpGYYjM%2BwvcRwid5UNdmnu65z2QrKBD8ISkqYZkpfeZPyRM%2Ff8Pba7r564yzxdSG6Cy2NnbydvPCDFrW1vUxVXCcfQQ%2FctffL%2BLGlu0NbtKLzvFCc0Q%2BnJu7049eglVVwuS%2F2gkHZHpeWdxRcOthDOyiPUFPbJENQXT4s9GFpvzaa5wfcP5SYTbA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1406,7 +1406,7 @@ include::example$troubleshooting/fix_policy_state_move_may_throw_2.cpp[tag=conte #### `two or more stateful policies in this registry share the same nested state type...` -*Example* - link:https://godbolt.org/clientstate/eNq9U11v2jAU%2FSuW99KqDEr3MC0FpH0g7WFrqlH1pVSRcS6JNceO%2FNENofS379pJSqCa9jZ4QD7n3OOD7bOnFqwVWlmakIc9FTn%2BTkeESqYKzwrAJeUXFxQhq73hEXgjFJc%2BBzIT2joDrFqs1Vod4NK52iaTyUYjr00xLoQr%2FWYs9ETXoCpwpc5bdgCMy7qORt4KVRDFKrA140CiMEkOyuugwp09d%2BRG4477tSL4eRLGeSbJcwDPzsmc5LBlXjocaIZDt9JbknSzR0y1ywwUAlc7FHTjL1CS%2FMJ%2FMqu1FFyATRLjlRMVZLwE%2FtMuTsy4RhpMH08oRxSGujyNw5mUNouuu17cHgJnDgqNWeZHojgcVA6qWqJmxiWzlvzoci5atrPfqt70YGwdTgXXNuJ1yzenycAYbf4Z7Uj137JFGvWDC2uVf7m14QGOjjO%2FXNynNF3dZent8ub78u5r%2BiX7%2FO3jarVcnYWnMorvZvR643OcDRXhuqqFBBPb9IgA%2FAbusQFdvXoeV13XKA9Nu3o3vQzzUmyGRaTx4QfiCT2xpQGbfriiTfDWteuKS99al8%2BxptP3tBnEuBdWbGSo7JZJCwMm9a727sDjgQaamcJXoFw0pUPgtRVuKVSvi4sTTfOI3z8%2B1ISL[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNq9lEuP2jAUhf%2BKlW5mNCkM00XVDCD1gdRFC6iZXRkh41wSq45t%2BTEUofS39zoJECioXRUW4Pude3ySG2cXMSUdSBcl5PsuclsN%2BA%2BLwpcyisk1XGolQznuLKa0bGkGk4w7ZU5w6qgLfBfxDH8GyASVed1xdxekVnnDaotXXDLhMyBDrqwzQMvxQi7ksVw4p23S768UcmXyXs5d4Vc9rvpKgyzBFSpraKfQK7SujbzlMicSA1tNGZBamCRH5WNQ4c6eOTLF6yG7hST4eeHGeSrIr1C8uSUjksGaeuGwoeo2zYW3JGl7T0i5XRrIOa62KGjbD6Uk2eCVDLUSnHGwSWK8dLyEJSuA%2FbDjMzOmEIPZx%2BPSEYmh7s%2FjMCqEXdau2724uQkMp5IrzDI6EdXNQeWg1AI1QyaoteRbm3Pc0NZ%2BLfemR2Mb5h1cm4iPDa%2FOk4Exyvw12onqv2WrMeo7A2uUV6bWvYHxaebD4D7MZunTcjafTL9Onj7PPi0%2FfnmfppP0Jjwqcf3cxH9ufIu9UVXF5F8PIfwE5q8fwcNRu3AMg5wLMHUpsIc3g%2FsABF%2FZ5kUg213qcxPQSyMfvHuIqmdcK%2B24kkEdvbYuG6H14O3RnAY6pxJEWqiNRNmaCgudzWfe7RHOIhBqcnuxBf35ZbONoXq%2FrKpn%2FP4GCA%2B0OQ%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1431,7 +1431,7 @@ include::example$troubleshooting/fix_policy_shared_state.cpp[tag=content] #### `+the type_hash policy must appear before vptr_vector in the registry's policy_list+` -*Example* - link:https://godbolt.org/clientstate/eNqlUstu2zAQ%2FBWCvSSIa8XpoSjrGOjDQA9tFMBBL3Ug0NRaWoQiCZFMaxjut3cpy7aa5BbqIOzMPgez5R68R2s8F%2BzXlmNJ%2F8mIcS1NFWUFFHJ1ccEJ8ja2qgPeoFE6lsCmaH1oQTazpVmaE1yH4LzIspUl3rbVuMJQx9UYbWYdmAZCbcs9OwDGtXNdo%2BjRVMzIBryTCliXKMQp82PKoslRBXZjaeJ2aRi9R2xDlJr9TeDZObtmJaxl1IEKdsOiWx09E33tf0yzKVqokKINJfTlR0iI33TJ1FmNCsEL0UYTsIFC1aAe%2FOzQ7LVSZIcJWYMGG6kLB%2B0aVChq6eujUP3OCYNysPdejZeXtzEM9g8bB13PWX%2FavjS9U9JLO0xnx2M%2F5%2Fnirshv5zc%2F5nff8q%2FFl%2B%2BfFov54izJO%2Bq0Hj3d8Zwqk6mUbRxqaDv%2F3RMAf0BFEqo35IGnqHcnV8mbV%2B8ml6le42poXd4JmYhH6km%2BTtjkwxXfpd7Whd7q%2FK0P5TUZe%2FKe7wZr%2FESPK51Mvpbaw4DJY3AxnHhSPtGyrWIDJnRN%2BRB43opGojnkdcGTnN09ff8AdmBAow%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU11r2zAU%2FSvCe2mplyzdw5iXBvYR2MMWB9y3pRhFvrHFZElIV81C8H77JNtJ3OJCYfKDfe85537p%2BhgxJREkRgn5dYzwoMF%2FeadwtYxi8hJcayWDOx4YK1r3aAHLgqMyT%2BAMKQb8GPHCv2YeE1SWreLmJlCtcoa1Id5wyYQrgMy5smiA1ouN3MiLu0LUNplOt8rjypSTkmPlthOupkqDrAErVXTowDGptG4DOctlSaQv2GrKgLTEJLkwPwWWz%2BwYkpXvhxw3kvjzyA06Ksjf4Ly6JnekgB11Ar2gGYrWwlmS9NonSH3IDZTcWwdP6OVnV5LsfSdzrQRnHGySGCeR15CzCthvuzgF%2B99RTE8ZpjWXvKYi12B2wDCvqK3Og%2BprDj4oBnV30xgvXjkc1B92po256FvrpOFcSGM1zBfnZr%2BkaXafp%2Bvl6ufy%2Fnv6Lf%2F643OWLbOrMN64nXX8vMZrr4yaJiavXVv4A8y9vLTn5RxZ3EDnAkzrCtjt%2B9m7AAi%2Btd2vI%2Fss7T0E6LGjzz7eRs2Dt5VGrmRgR28tFnc%2B9OzDJTgN6JpKEFml9tLTdlRYGCRPHZ4gf2kBoaa0oxIfn48H2xuqT2bTPPjnH0dHcFE%3D[Compiler Explorer^] [source,c++] ---- @@ -1457,7 +1457,7 @@ include::example$troubleshooting/fix_policy_order.cpp[tag=content] #### `minimal_cover_hash needs BMI2...` -*Example* - link:https://godbolt.org/clientstate/eNqlUk1vEzEQ%2FSuWubRqyJJyQJg0Eh%2BROEC3UioupFo53unuCK9tre1CFaW%2FnbG7SRZy4MD6sJr35vPpbbkH79EazwX7vuVY0382YVxL00TZAIVcXVxwgryNvcrACzRKxxrYHK0PPchusTZrc4TbEJwXRbGxxNu%2BmTYY2riZoi2sA9NBaG39zI6AaetcbhQ9moYZ2YF3UgHLiUIcM9%2BlLJocVWDXliZu14bR94B9iFKzpwSenbMrVsO9jDpQwW5cdKOjZ2Ko%2FYPpHqseGqTokRKG8gMkxE%2B6ZO6sRoXgheijCdhBpVpQP%2Fxi3%2Bx%2FpSj2E4oODXZSV8o%2BQF%2B10rcHmYaNMwP1aO1nMf65%2B2nr%2BeJwwYeyXN1W5c3y%2Buvy9nP5qfr45f1qtVydJc0mWcDJyehzKk1WUbZzqKHPrrojAH6BinT%2BYLM9T9HgOa6S4y5fz16leo2bsSF5licRNC65NWGzt5d8l3pbFwYD85c%2B1Fdk19kbvhut8Q09bnSy7r3UHkZMGYOL4ciToomWfRM7MCE35WPgtBWNRLPPy8FfObs7er8Bi9MyqA%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU91vmzAQ%2F1cs9tKqLDTdwzSWRlq7SHvYQiT6tlTIMVewamzLH8miiP3tOxOSUDXVJg0e4O73cefj2EVMSQfSRSn5uYvcVgO%2BYVL4RkYxeQtutJIhHQ%2BCOW16tIRZyZ0yL%2BDcURfwXcRLfIwRE1RWneLqKlCt8oZ1Fu%2B4ZMKXQCZcWWeANtOlXMpTunZO2zRJVgpxZapRxV3tVyOuEqVBNuBqVe7RQWJUa90ZectlRSQ2bDVlQDpimp6YnwMLK3vmyBzPQ3ZLSfBac%2BM8FeR3SF5ckltSwhP1wqGgHYoWwluS9toXSLMtDFQcoy0SevkxlaYbPMlEK8EZB5umxkvHGyhYDezZTg9m%2FzuK5FAhabjkDRUFU2swRU1tfRxT33GHQDloez%2BMv%2Fb%2B2noyPZ7gLsvyhyJbzOY%2FZg%2Ffsq%2FF%2FfcveT7LL8LM4m6A8avSlyiN2jYm%2F7qM8AuYf3sVjyt3Zh0DnQswXSpgNx%2FG1wEQfGX3P4Tsq3TTDdB6Tx9%2FuonaR4yVdlzJwI7eW1feovX448mcBnRBJYi8VhuJtCcqLAyKZ94dIPwYAaGmsmcl6M%2FPm20M1YewbR%2Fx%2FgOYqmJW[Compiler Explorer^] [source,c++] ---- @@ -1498,7 +1498,7 @@ The examples need a compiler that supports reflection, such as GCC 16 with #### `a group holds reflections of namespaces, classes or registries` -*Example* - link:https://godbolt.org/clientstate/eNplUUtP20AQ%2Fiur7QVESRQOSGxDDlWjtodiBBGXBqzNemKPut5d7YOCIvPbmTUOMW18iOZ7jT3fjgcIAa0JXLDfO44V%2Fc8%2BM66lqZOsgUauTk44QcEmr3rgExqlUwVsjjZED7JdrM3aHOAmRhfEdLqxxFtfT2qMTdpM0E6tA9NCbGz1xo6ASeNcH5QCmpoZ2UJwUgHrhUIclF%2ByijYnFdmVpY27tWH0e0Qfk9TsJYNHx%2BySVbCVSUcydGPTtU6BicH7gWmfSw810vRMgsH%2BDgnxl75k7qxGhRCE8MlEbKFUDag%2FYbEP%2B1oUt6uyuF5e%2FVqufhTfypvl95%2B3q%2BXN0VsS%2BFJpGej4893DA5rYLY7JmM%2BsbOtQg%2B8buScAnkAluuJQ0Z6naeiL17PzWbZq3Ix75P3dMvFIcVRyxmYXZ7zLsdbFoXd%2BGmJ1SS2fnbPTrYetBpU53o1e5w4DbnSufyt1gBFTpOhSPPB0x0xLX6cWTOw38DHwfxTtR7PX9cM%2Fmu6enleUP%2Buy[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUk9v2jAU%2FypWdmlVCqKHSssoh2nRtsMIKtxGGxnnkVhzbMt%2BLkNR9tn7HKBQiUqLD8n7%2FXu2X9pEGI2gMUnZ7zbBnQX6IlCFRicD9hHdWKMjPDgrZrw5sCVkpUTj3tEL5Bj5NpElvcbEKa6r3nFzE6XeBCf6iE9SCxVKYBNpPDrgzXSlV%2FoE14jWp6PR2hBvXDWsJNZhPZRmZCzoBrA25Z49A4a1tX1Q8FJXTNOGveUCWC9M05PyS1RR5yCQzeg8rF1pRs%2BLdBi4Yv8ieHXNHlgJGx4UkqE7N81V8Cw9eN8xza5wUEmqdiQ42N%2BgNN3SSSbWKCkk%2BDR1QaNsoBA1iD9%2Begz7mueLZZHPs9mvbPkj%2F1Y8Zt9%2FLpbZ49U%2BCVwhFPce%2FKR9fpYau%2Bk1GZOuG7D%2FHST8BRE%2BHuPbuC6MMsqlAhehanw%2FjpiSa7%2F%2Fj%2FShQX%2FtkXrZK8ef75LuiWpjURod1cmtx%2FKBUu%2Fu2e3GwUaBiNypCY%2FlnGtQi9psNXk2XHk420Qe8EjRCCLDXeUvWqiZvBy2ddwey657ovUKPw0bbw%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1522,7 +1522,7 @@ include::example$troubleshooting/fix_register_classes_not_a_class.cpp[tag=conten #### `a group holds one kind of reflection...` -*Example* - link:https://godbolt.org/clientstate/eNplUk1v2zAM%2FSuCdmnRNkF6KDAtzaFYsO6wumiDXZbGUGTGJipLgj66FYH320e5zuKt1kHge%2BQjzac9DxACWhO4YD%2F2HCu6Z%2BeMa2nqJGugkKuzM05QsMmrHviARulUAZujDdGDbBdrszZHuInRBTGdbi3x1teTGmOTthO0U%2BvAtBAbW72xI2DSONcLpYCmZka2EJxUwPpEIY6Zn3IWdU4qsjtLHfdrw%2Bh7QR%2BT1Ox3Bk9O2TWrYCeTjlTQjYvudQpMDLX%2FMO1r6aFGil4pYSj%2FCwnxk%2F5k7qxGhRCE8MlEbKFUDajnsDiI3RTF46os7pd335ar2%2BJz%2BbD88vVxtXw4eVMCXyotAy1%2Fvt9s8hjnbLPJU%2BV7NEO3OCXBvH5lW4cafO%2FUEwHwC1Si7Q7WHXiKBh95Pbua5VKN27G%2FvN9nJl5IjszP2OzjJe%2ByrHVxeA%2F8IsTqmty%2FvGIXOw87DSpzvBuN8x0DbnV%2BFjupA4yYIkWX4pGn%2FWZa%2Bjq1YGLfgY%2BB91LUH80hrw%2F%2By%2Bme6PwBIkz0Xw%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUs1v2jAU%2F1es7NKqFEQPleZRDlOjbYcRVLiNEhnnkVh1bMsfZSjK%2FvY%2BByipRKUlB%2Bf9vt6zXpqEa%2BVB%2BYSSP03i9wbwC0EZapUMyGd0bbSK8KBXzFh9ZAtIC%2BG1%2FUAvPPORbxJR4DFGTjJVdo6bmyh1OljeRXwRistQAJkI7bwFVk9XaqXOcOW9cXQ02mjktS2HpfBV2AyFHmkDqgZf6eLA9oBhZUwXFJxQJVE4sDOMA%2BmElJ6V36IKOwfuyQzvQ5qVIvi8CusDk%2BRfBK%2BuyQMpYMuC9Gho%2B6a5DI7Qo%2FcDU%2B9zC6XAao%2BCo%2F0donSHN5kYLQUX4Ci1QXlRQ84r4C9uegr7nmWLZZ7N09nvdPkze8yf0h%2B%2FFsv06eqQBDbnkjkHbtKs13GMAVmv41Tx7M3QTq8xMGnbAfnfBcNf4OHz9b6v8cKKo1xIsBEqx%2FfjiEmxcYf%2FSx0bdOuI1OtBOf56l7TPWGvjhVZRndw6Xzxg6t09ud1a2ErgkTs3YbGcMwVyUemdQs%2BWSQe9IbLgTxSuJjLMlu6iBZuJy2E7y8ypbNtnfN8AXLQkHA%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1545,7 +1545,7 @@ include::example$troubleshooting/fix_register_classes_mixed_group.cpp[tag=conten #### `order the groups as namespaces, classes, registries` -*Example* - link:https://godbolt.org/clientstate/eNplUstu2zAQ%2FBWCvSSIY8M5BCjr%2BFDUaHtoFCRGL3Us0NRaWpQiCT7SBob67V0qcq2k0kHYmdlZaocHHiAEtCZwwX4cOFb0nU8Y19LUSdZAJVcXF5ygYJNXPfAOjdKpArZAG6IH2S43ZmNOcBOjC2I221nira%2BnNcYm7aZoZ9aBaSE2tnphR8C0ca43SgFNzYxsITipgPVCIU7KD1lFk5OK7NbSxMPGMHqe0MckNfuTwbNzdsMq2MukIzV046Y7nQITQ%2B8rpn0uPdRI1TMJhvZ%2FkBC%2F6E8WzmpUCEEIn0zEFkrVgPoZlkezj0XxsC6Lu9Xtt9X6S%2FGpvF99%2FvqwXt2fvTiBL5WWgZa%2FOGy3o5ndhBGQzzVh220%2BZrc8J8scgLKtQw2%2Bz%2BqRAPgNKtF%2Bh%2FCOPFVDkryeX89zq8bdOGHebzQTT2RH8Wds%2Fv6Kd9nWujjcCH4ZYnVD%2BV9ds8u9h70GlTnejY7zHQPudL4Ye6kDjJgiRZfiiacNZ1r6OrVgYj%2BBj4H%2FrWg%2BmqOuL95oukd6%2FwJ9p%2FVX[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUs1v2jAU%2F1es7NKqFEQPleZRDlOjbYcRVLiNEhnnkVh1bMsfZSjK%2FvY%2BByipRKUlh%2Fj9vt6zXpqEa%2BVB%2BYSSP03i9wbwhKAMtUoG5DO6NlpFeNArZqw%2BsgWkhfDafqAXnvnIN4ko8DNGTjJVdo6bmyh1OljeRXwRistQAJkI7bwFVk9XaqXOcOW9cXQ02mjktS2HpfBV2AyFHmkDqgZf6eLA9oBhZUwXFJxQJVE4sDOMA%2BmElJ6V36IKOwfuyQzvQ5qVIvi8CusDk%2BRfBK%2BuyQMpYMuC9Gho%2B6a5DI7Qo%2FcDU%2B9zC6XAao%2BCo%2F0donSHN5kYLQUX4Ci1QXlRQ84r4C9uegr7nmWLZZ7N09nvdPkze8yf0h%2B%2FFsv06eqQBDbnkjkHbtKs172e7YAgEOcakPU6jtlOrzEyaSPznyuGv8DD5wt%2BX%2BSFJUe5kGAjVI7vxxGTYuMOf5g6NugWEqnXg3L89S5pn7HWxgutojq5db54wNS7e3K7tbCVwCN3bsJiOWcK5KLSO4WeLZMOekNkwZ8oXE5kmC3dRQs2E5fDdpaZU9m2z%2Fi%2BASS0JRQ%3D[Compiler Explorer^] [source,c++] ---- @@ -1568,7 +1568,7 @@ include::example$troubleshooting/fix_register_classes_group_order.cpp[tag=conten #### `a listed class must be complete` -*Example* - link:https://godbolt.org/clientstate/eNplUk1PGzEQ%2FSuWewEBicIBCTfkUDWiPcAiiHppyMrxTnZHeO2VP6Ao2v72js3SbOn6sJr3Zt7Y82bPPXiP1ngu2M89x4r%2Bs1PGtTR1lDVQyNXJCSfI2%2BhUBj6hUTpWwOZofXAg28XarM0BbkLovJhOt5Z46%2BpJjaGJ2wnaqe3AtBAaW72xI2DSdF0Wih5NzYxswXdSAcuJQhwyP6cs6hxVYLeWOu7XhtH3jC5EqdnvBB4dsytWwU5GHaigHxfd6eiZGGr%2FYdrX0kGNFL1SwlD%2BFxLihV4y76xGheCFcNEEbKFUDagnv%2FggdoP0lgx8KYqHVVncLW9vlqtvxdfyfnn9%2FWG1vD96kwZXKi09uTHfbzbpXqdss8n1%2FeKYJJIDyrYdanDZrEcC4BeoSAMe3HvnKRqs5PXsYpZKNW7HFvM80kQ8kxz5n7DZ5Tnvk6ztwrAS%2FMyH6ooW4PyCne0c7DSoxPF%2BdJ0f6HGr02bspPYwYooYuhgOPE0l0dLVsQUTcgc%2BBv6Xov5o3vNy8CGnf6TzB4fY9aE%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNUktP4zAQ%2FitW9gKitCoHpDWlB0S0uweaivZGaeQ608Rax7b8oFtF2d%2FOOC20oCKRHJL5XjPOpEm4Vh6UTyh5ahK%2FNYBvCMpQq6RHvqJro1WEe0fFhNV7toC0EF7bD%2FTMMx%2F5JhEFPobISabKznFxEaVOB8u7iB9CcRkKICOhnbfA6vFCLdQBrrw3jg4GK428tmW%2FFL4Kq77QA21A1eArXezYI6BfGdMFBSdUSRQO7AzjQDohpQflTVRh58A9meB5SLNQBK8XYX1gkvyP4Nk5uSUFrFmQHg3tsWkqgyN07%2F3A1NvcQimw2qJgb3%2BHKN3gSUZGS8EFOEptUF7UkPMK%2BF83%2FhT2IPAsHXCXZbN5nk3TyUM6%2F53d54%2Fprz%2Bzefp4tosGm3PJnAM3apbLOFePLJedvx2fY0TStj3y3R3DP%2BDh6w2%2Fb%2FLElqNcSLARKofXw4hJsXK7X0ztG3QbidTLTjn8eZW0z1hr44VWUZ1cOl%2FcYurVNblcW1hL4JE7NGGxnDIFclbpjULPmkkHR0Nkwb9R%2BEEjw2zpTlqwmTgdtrHMvJVt%2B4z3K1w0JV4%3D[Compiler Explorer^] [source,c++] ---- @@ -1646,7 +1646,7 @@ xref:reference:BOOST_OPENMETHOD_CLASSES.adoc[BOOST_OPENMETHOD_CLASSES]. So must the class of every object passed as a virtual argument. cpp:initialize[] detects the first two omissions: -*Example* - link:https://godbolt.org/clientstate/eNqlUl1vm0AQ%2FCur6wtWXKjTh6o4iZTWSK3UliqO8pJE1gEXvMpxh%2B7DqWrR3949jG2U%2Bq3wADuzM%2Byxs2VWWItaWZbC%2FZZhRc%2FZFJjkqva8FlSy8uyMEWS1N2UPvEFVSl8JuFg719o0SQqtrdOmjmt0a1%2FEqBPdCtUIt9bVjh0B8bptrx7U%2F9okqNAhl%2FhbDI5jT%2BsMqroHvaU3ULwRtuWlgN4oTY9O89BFAl86uFbYcAnbBwV0bdA4T%2BWfHRxN4BIq8cS9dCTq5gfZQteQHsRd7%2Fgpz5e3q%2Fxn9uN7dvslX6w%2Bf7teLrNlRM2TOSTJvh8tNGjDlKdkUaufxRSiYZZV68zFTng1mcJGYzU5%2Fbn8Lru5%2BbrIThnQCAf1%2FrA0UBzHdKzghspBw1FFY5oX2jgLL7QeEMZoA%2FRPLeUkBa%2BelX5RUEpu7XCwne64pigMSu4hTqVuWpTC9Ml7JED8EqWn7Q9R3PNUDblkZUjl%2BfvZu6CXWIxDy%2FqlBmJDnpTogM0%2BnrMueOvWDSFnb62rLinSsw%2BsG41xhxYLGeL9xKUVIyb3rvXuyNO%2BA81N7RuhXG%2FKxsC%2FVvRJVPu%2BvnjV0z3S%2FReOuDN3[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU91vmzAQ%2F1dO7IWoGSzdwzTSVuoWpE3aSlWqvaxV5IALVo1t%2BSPZFrG%2FfWcgCZOoNGnwgO9%2BH76zj31QSGGpsEEC3%2FeB%2FakorjDJXSOCObwEN0oKn56PghvSDGhJ05JZqf%2BCc0usx%2FcBK%2FGzQIwTUXWKszNPNdLporN4xUTBXUnhorZWmSSON1IadKyiitnabSImY6moaKitZdmjo0RUK3X1IP7XJmaCWUY4%2B0UHx7GnsZqJqks6gysQeABGkYJCZ5QkJ6elZ6HAFRauBWsIh%2F2DAHy2TFuH4e8%2BHc7gEkr6RBy3KGqXR9lKVpAcxW3n%2BCHL8vt1dpvefE3vP2Wr9ccv13me5iGSZ0uI4wOfGWiY8VVOyUIln%2BkcwqGWtbL6ohdezeawlaycTW%2BXfUvv7j6v0ikDLOGoPjSLBUVRhG15NyYsNISJcAyTjdTWwA6vB6jWUgOeqSEVTcCJZyF3AgpOjBka63Wnawp9oegetO0c%2FnVg6Q9auJfH9TiWEyPr6YxT3aU8dv528cYDnG1M%2F9OIYZduJjy07emL9%2BdB%2B4ixVJZJ4dnBa2PLS7RevDuZE4%2FeEkF5XmP7SHsi3NDR5pmzBwhHxSNEV2ZSgv5s2myniTqEbfuI7x9BeGMl[Compiler Explorer^] [source,c++] ---- @@ -1655,7 +1655,7 @@ include::example$snippets/errors_missing_class_method.cpp[tag=classes] include::example$snippets/errors_missing_class_method.cpp[tag=init,indent=0] ---- -*Example* - link:https://godbolt.org/clientstate/eNqlUl1v00AQ%2FCur48VRg03KA8JpKxUSCSTAqKn60lbR2b46q57vrPtIEZH57ezZTmKVvBE%2FxDuzM7fnnR2zwlrUyrIU7ncMS%2FqfTYFJrirPK0ElK87OGEFWe1N0wBtUhfSlgIuNc41NkyTX2jptqrhCt%2FF5jDrRjVC1cBtd9uwIiDdNc%2FWg%2FtcmQYUOucTfYnAce1pnUFUd6C29geK1sA0vBHRGaXp0mocuEvjCwbXCmkvYPSig3xaN81T%2B6eFoApdQiifupSNROz%2FIFrqC9CBuO8dPWba6XWc%2Flz%2B%2BL2%2B%2FZIv152%2FXq9VyFfVtkzkkSSdECzXaMOUpWdToZzGFaJhl3Thz0TtcTaaw1VhOTh%2BX3S1vbr4ulqcM6NiDen9ZmiaOY7pWcEPloOaoojHNc22chRdaDwhjtAH6ppZykoJXz0q%2FKCgktzbcqhcddxSFKck6ZKnQdYNSmC52jwSIX6LwtPohh3ueqiGUrAiRPH8%2Fexf0EvNxYlm30UBsyZPiHLDZx3PWBm%2FduCHh7K115SXlefaBtaMx7tBiLkO2n7i0YsRk3jXeHXladqC5qXwtlOtM2Rj414qORLXv64pXPe0jPX8Brb8yPw%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlk9tunDAQhl9lRG9YhUI3vajKJpHSLlIrtSEKUW%2BaaOUFB6wY2%2FJht%2B2KPnvHsAcqEalS4QJ7%2Fvm%2F8WHYBaUUlgobpPB9F9ifiuIIg9y1IojgJblVUvhwNJrckHavVjSrmJX6L7mwxHp9F7AKP3PUOBF17zg786lGOl32iFdMlNxVFC4aa5VJk2QtpUFiHdfMNm4dM5lIRUVLbSOrQR0F4kapqwfxv5iECWYZ4ewX3RPHTGM1E3UfdAZHIPAAjCIlhR6UpifSwmehwZUWrgVrCYfdgwB8Nkxbh9PfQzicwSVU9Ik4btHULY62pawhPZq7nvghz4v7VX6b3XzN7j%2Fly9XHL9dFkRXhkDZbQJL0RmagZcavcsoWKvlMIwj3a1kpqy8GwtUsgo1k1Wy6XP4tu7v7vMymAFj26D5sFlcTxzFuy9OYsNASJsKxTNZSWwNbvB6gWksNeKaG1DQFJ56F3AooOTHG72owne4o9KtEdNB1Efxrt9IftHQv9%2BqxJyf61aczTnUf8tr52%2FkbL3C2NsMfI%2FZV%2Bobw0mZIn78%2FD7pHnEtlmRQ%2BO3htbHWJ6Pm7E5x49ZYIyosG945pT4QbOiqeO3uQsE%2B8QnRtJi3IZ9OwrSbqMO26R3z%2FAMhXYe0%3D[Compiler Explorer^] [source,c++] ---- @@ -1668,7 +1668,7 @@ The third one can be detected only during the call, and only if runtime checks are enabled. Otherwise, the call reads a v-table pointer that was never set up, and the behavior is undefined: it may call the wrong overrider, or crash. -*Example* - link:https://godbolt.org/clientstate/eNqlU11vmzAU%2FSuW%2B0LUDJbuYRr9kPKB1GptmELWl6VCDrjkqsZG2E6nRdlv3zUkBLV9GzyAz7nn%2BNr33h3VXGtQUtOQ%2FNpRyPE7GhIqmCwsKzguaXZ%2BThHSytZZA5zl%2FBkkJ5M4TpZp%2FCOaP0TL23iWRvPx5D5KFz%2Fny7uHKJ3eRtPvyUqu5BnITNick6uNMZUOg2CtlDaqLvwCzMaufVCBqrgsudmovGV7gL%2Bpqpv%2FtwlAggEm4A8%2FOPY9talBFg1oNf4RyUquK5Zx0hiF4cnp0kWhwGaGjCWUTJDdShJ8tlAbi8u%2FLewNyDXB%2B2JWGBTtLzvZTBUk7MQ9YmKFyBvShTTMSgZBh4MmJWiX4Uq%2BK8H0fpwkUeK1vkNnMWgM3kZ6lXrhQ%2BId8k0rU1%2B1opvBkGwV5B%2Fr0vgxWizuZtFHBrhbpz5eCGbu%2Bz4e3bmBNKRkIL2OPpXEazd04PGoG55hdTsYrdha1UaTVyw34XWtaoI10tipIbHyRapXSTLBtD5atEKXqteauU0wFdfRmSorELxumv8JAf6bZxZjDtNw5HF1GA2aucG4%2BDL67PQC1v25oU2XOGKLnjhUDht9u6B7560qc5gz%2Bkmb%2FBqnavSV7ntpPIKGtXAT9syE5j0mtqay5sRjnzia1YUtuTSNKe0D761wS5DHuGbxJmb%2FhO8%2F0z5fMQ%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU11vmzAU%2FSsWfSEqg6V7mEY%2FpHwgtVobqpDtZamQAy5YNdcIm6RbxH77riEh2ZZKkwYP4HPuOffa13drJRI0A2355NvW0t9Lhn8IiroAyyFv0UUpwcDO0WJGix2bsiDlWla%2F0ZGm2vBbi6f4GSInKGSt4vzchCpZV0lrcZayZw6MjMMwWsThYzB7CBa34TQOZqPxfRDPv8wWdw9BPLkNJp%2BjJSzhjEMi6pSRq1zrUvmet5JSYQ2Zm3Gd1yuXS0%2BWDAqmc5l27BHg5mV58%2F82HgeuORX8B9s5HnsqXXHIWrBW%2BEcAj0yVNGGkNfL9g9OliUJBnWgyAl5QQbZLIPiseaVrXP7sYHtArgmeF62FRlFz2cumMiN%2BLz4ixrUQaUuakJZZguf1OFek4MpUuIS%2FWjC5H0VRENmdr2MsBq3Bn5F2KV%2BYQ%2BxdvXGpq6tOdDNwyFry9LQuDr8G8%2FndNDhlgNl69f5AsHLXdXHrxo2DJgXlYPf0oSV2l9CA%2B63mLMHu9jBa0ZWstCIbbDdhVSUrgj1SNGM%2BqeEF5AZIIqhSe4tOaEq1OzOTBEuxmsYh%2Fzoz7JUl9dsT00%2FGiakx4VywqoUMd%2FFh%2BN4Qgq9UN7ewy9JeMkOtu%2FDhpwurecK1LDWXYKKtd0qn12g9%2FHgwp4Z9pMBElOP%2BMeyZCsWOkoe13lN4xQxDq0ydlKA%2FP222qWi5XzbNE76%2FAMRbjt8%3D[Compiler Explorer^] [source,c++] ---- @@ -1703,7 +1703,7 @@ that are registered separately are unrelated, as far as OpenMethod is concerned. If an overrider implies that one derives from the other, `initialize` reports it: -*Example* - link:https://godbolt.org/clientstate/eNqlU9tu00AQ%2FZXR8uKoqU3KA8JJKxUSCSTAqKn6QqtobU%2FtEfautZdCCeHbmXVuVql4wX6w53LOzO6cWQuL1pJWVqTwdS2o5O9kDKKRqvKyQjZFcXIi2GW1N0XveEGqaHyJMKud62yaJLnW1mlTxRW52ucx6UR3qFp0tS630YEjrrvu4lb9L01CihzJhn7ijnHIaZ0hVfVOb%2FkPlGzRdrJA6InS9Mg0DVkM8IWDS0WtbGB9q4CfBzLOs%2Fl7645GcA4l3kvfOAZtpgfYXFeQHsCbnjFJwGBF1qHBEix20kiHzeMYrAZXI5Cq0ZCTipsiCwof0HAeMvZtli2vV9mXxedPi%2Bv32Xz17uPlcrlYRtsSo%2Bk%2FUriXUd%2FA04yo099wDNHuVKvOmdmW72I0hgdN5fO4VXazuLr6MF88R8DVDuj9tfHJ4zjmCwpspBy0klQ0DMtcG2fhOw8a0BhtgKdjWXEptGT7geXS4v5GT2e%2FwhVv4ce5R6FfLhL0Wei2owZNL%2BU7duAPLDzLaaftfZytndBFEWR%2B9mryMuAbyodbIHqVhAAPJaxI8E3enIlN4Nad222NOLWuPOcdmbwWm0EbN2Qpb8K%2B3MvG4iCSedd5d4yzgEJYmsq3qFxPKoaOv6m4JKl9Xm88ydnc8fsHN11PHQ%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU91v0zAQ%2F1dO4SXVsoSOB0TaTRo0EkiwTsvEC5sqN7klFokd2ZeOUcLfzjnpF6hDSCQP8d3v4y5ne%2B1lWhEq8mL4svboqUFecbJqa%2BUF8BxcN1q5dHAQXIl6g%2BaY5JK0%2BQ1OSZDD157M%2BTNmrBKq6BUnJ45qdWuy3uKFVFnV5gjTkqixcRQttbbsWISFpLJdhlJHukFVI5U6H9CDRFg2zcWd%2Bl%2BbSCpJUlTyO24cDz0tGamKPtlaXoHiAdhGZAi9URzvnSaOxYI2I7hUshYVrO8U8LOShloOfw5pfwTnkOODaCtiUTfZyWa6gHgn7nrHKAKDhbSEBnOw2AjDQ66eArAaqESQqkQjSShuSlpQuELDPGTt2%2Fk8vV3Mr5OrT8nt%2B%2Fls8e7jZZomqT%2BUGE3%2BQuFeRn0DfzL8Rn%2FFAPzNXy0aMtPB72IUwErL%2FLhuMf%2Bc3Nx8mCXHDLjaTr0dG%2F95GIY8IOcmFUEtpPIPYbHUhiw88kYDGqMN8O5YUWAMtbT9hi2Fxe1ET6c%2F3IgH%2BX7ffdcvF%2FG6LoB%2FvQH4DbP2%2BfO%2FO%2BdH7oCjywpNn3LY2avxSwdUcmmHW6g2VfpD5qDVQB%2B%2FOfO6e451Q1Irx%2FZOLeXnbD1%2BvTcXDr0WCqu01I%2BKaQ%2BisnhQfN7SFuKz5xBhCntUwv7yuNmjEc027Lp7fn8BA8V%2Byw%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1733,7 +1733,7 @@ Error type: cpp:no_overrider[]. No overrider is applicable to the dynamic types of the virtual arguments: -*Example* - link:https://godbolt.org/clientstate/eNqlU01vm0AQ%2FSur7QUrDtTpoSr5kNIYqZXaUsVRLnFkLbDGoy67q%2F1wo1jub%2B8sYIxS3woHNO%2FNe7MDjx213FpQ0tKUPO0oVPicTQkVTNae1RxLWp6dUYSs8qZsgXcgS%2BErTq42zmmbJkmhlHXK1HENbuOLGFSiNJcNdxtVdewIiDda3yzl%2F9okIMEBE%2FDKe8el9BZkTSRruNWs5KTVpOlRdBm6rDO%2BdORWQsME2S0lwWsLxnks%2F3RwNCHXpOJr5oVD0f5ykM1VTdJBPCLumHtDLOXnPF88rPKf2Y%2Fv2cOXfL66%2B3a7WGSLqGubBrdpUE5Otkda%2FeJTEvWHW2lnrjrlzWRKtgqq07pV%2Fpjd33%2BdZ6cMcOSgPmyfJCSOY9wzuIF0pGEgo4E%2BvuqoGxjAsO%2BaC3gZEHRhhTLOkt%2F4BQk3RhmC38JilFIilSPQaMEbLh2vOkk4X9S6BGMcH7JWqkaD4KaN5TMC%2FIWXHqPR5%2FTAY9WHlpYhshcfZu%2BDXkAxTjRtYxCILXpi3AM2%2B3RB98Fbadf%2FAfTcuuoa8z77SPejYzyChUKE7K%2BZsHzE5N5p7448BiHQzNQ%2BLNma0jHwrxWOBHnoa4s3PftnvP8Cn607wA%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU1tvmzAU%2FisWeyEqg6V7mEYvUtcgbdJWqlLtZakiBxxizdiWfZx0i9hv3zEkJJuoNGnwAOd8l2Pjj11QKglMQpCSb7sAfmiGb9gUrpFBRF6CG62kb0cnxR1t9mjFsoqDMn%2FABVDw%2BC7gFT6miAkq605xduapVjlTdhavuCyFqxi5XANomybJUimLjnVcc1i7ZcxVojSTDYO1qnr0pBGvtb6ey%2F%2B1SbjkwKngP9necS6d5bImEvdqNS0Z6TRpehRdeJYF40ogN5I3VJDdXBK8NtyAw%2FJX3w4n5IpUbEWdABS1F4NspmqSDuIT4JbCX8Bcfsjz4nGR32d3X7LHj%2Flscfv5piiyIuxpkXeLvHIySg%2B1%2Bs4iEu4Xt9BgLnvl9SQiG8Wrcd0i%2F5o9PHyaZWMGOHJQH3afJCSOY9ynd%2BMSSEO5DAf4%2BKnDfqBv%2Bv2umODPQwdd6FIZsGSLJ0iYMcoQPAtLa5YSqYDwRgvWYOBY1Uv8%2BsLOxRvj%2BKBtI%2FKvaWbPrHQvZ3nI7EiePZ0LZrqWx87fTt94QPCl7f8ouZ%2FSpchDm54%2BfX8etE9YKw1cSc8OXluortB6%2Bu5oTj16TyUTxVptJdJWVFh2Mjx3cIAwQx6hprajEvTn42ZbQ%2FWhbNsnvH8DcC1rbg%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1779,7 +1779,7 @@ Error type: cpp:ambiguous_call[]. Several overriders are applicable, and none of them is more specialized than all the others: -*Example* - link:https://godbolt.org/clientstate/eNqlU9tunDAQ%2FRXLfWEVCt30oSq5SGkXqZXaUmWjvGSjlQEHRgLb8iW9rOi3dwwsS9pV1arwgObMnDNjM2dHDTcGpDA0IXc7CiV%2BlyGhDROVYxXHkBYnJxQhI50ueuAZiKJxJSfntbXKJHGcS2ms1FVUga1dHoGMpeKi5baW5ZCdAVGt1OVG%2FK9MDAIssAa%2B81FxI5wBURHBWm4UKzjpOUlyIJ35KmO1Kyy5EtCyhuw2guDzCNo6DH8McLAgF6TkD8w1Fknd2URbyYokE7nrFd9k2fpmm31OP31Mb95lq%2B3bD1frdboOhrLQkxZHK4OWcxuSYGy%2FVVafD6TLkBwBF4hKKI%2BLbbPb9Pr6%2FSr9a1Wca5Lc30QckyiK8Mz%2F3MKr%2FXHqoy1AWNIyEMGUPvzZYDioB%2F29GyGl%2BhaSmhe4KFMK5VgutTXkC24O4VpLTXAHDK5wQlibQ%2BWkM0Oxnzt4KuSb4Ch%2BzQvZKmi47h1xjwD%2FyguHNaNF9nmMRr%2FQwrvl9OXyhec3kM%2FNRPsN9IlH1ESneWz5%2BpR2XlsqO5qPPje2vECrLV%2FRbjbGLRjIG2%2B7B9YYPstkzipnD3lcTp9munItF7YXpXPgdylsCWJf1we%2F1HT3%2BP4EOIBl2A%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlU91vmzAQ%2F1cs9kJUBkv3MI1%2BSN2CtElbqUrVl6aKDLhgCWzLPjdrI%2Fa37wwJSSU6dRo8wN3v485wt%2FEKKYAJ8GJyt%2FHgSTF8w2RjW%2BEF5DW4VVK4dHAQXNJ2i5YsKTlI%2FQLOgILDNx4v8TFHrKGi6hVHR45qpNVFb%2FGOi6KxJSOnNYAycRTlUhp0rMKKQ23zkMtIKiZaBrUsB%2FQgEdZKnS%2FF%2F9pEXHDgtOHPbOu4FNZwURGBZzWKFoz0mjjei04cy4C2BZALwVvakM1SELweuQaL4e8h7c%2FIGSnZA7UNoKg7GWULWZF4FHe945c0zW5W6VVy%2BTO5%2BZYuVl9%2FXGRZkvkDLXCi2STTbxmDgPjb8isF%2BnQQnQdkIjnDrOTltNkqvU2ur78vkje7Yl%2Bj5e5LRBEJwxDP%2FM8lnNtfu54swQWQlnLhj%2FD%2Bz%2FrDQV3SfXcjpFRPAalZgYMyQmhHc6nBkDVODmFaS01wBgytWExom%2FPKSmsGsuvbf2nkimArXtcF5K2LxH6xwr6%2BRuO6TKySo%2FOG6T7lsOOP8w8OaHhuhmUW2yr9ADvocaDPPx973T3GUgGXwrG99wbKM7Sef9qbU4deUcGarJZrgbQH2hh2UDy1sINwrh1CdWUmJejPp83Wmqpd2HX3eP8B%2FAuVhg%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1831,7 +1831,7 @@ Error type: cpp:not_initialized[]. A method was called before cpp:initialize[]: -*Example* - link:https://godbolt.org/clientstate/eNqNU11vmzAU%2FSuW%2B0LUjCzdwzT6IaUJUqu1YQpZX5YKGXDI1cC2sJ19RNlv3zWQBK15GDzAPfecY1%2F5eEc11xqk0DQg33YUcvyOh4SWTBSWFRxLml1eUoS0tHXWABewFjlfk%2FsoipdJ9CWcP4fLh2iWhPPJ%2FVOYLL7Ol4%2FPYTJ9CKef45W4QDII%2Fv98LnJYrwT%2BgchKm3NyszFG6WA0SqXURtaFX4DZ2NQHOZKKi4qbjczbbg%2FwN0rdOSOrQRREsIprxTJOGmIQnJjXjqVNbTNDJgIqVpLdShB8tlAbi%2BWfFvYG5JbgQMyWBkX766NsJgsSHMX7xvHNyNOnSRyHsdfShk40OMv0lPzOh8Trlk%2BUqW9a0d1gSLYS8vO6JHoJF4vHWXjOAFc7qg%2FzjUbE932cxLmBMKRiILx%2BGwQYYCX85ghvmCZCGpJyLkjGypLnLdGNr4WU6lezr07LUlkbTX7gaRFe17ImeAQakxU0LifrzsVt2mtt3Hy4KZe9TFYKSl43MX1FgP%2FkmcUcdLk99LHqQkwzF%2BGrD%2BP3Tl9C2k84bY7fNbboifF32PjTFd07b6lMdyPoO23yW8z%2F%2BCPd97bxAhrS0t2FNSs173Uia5Q1pz4mw7VZXdiKC9OY0j7w1gqXBHHgNcU%2FnP0rvn8ByxM7hA%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqNU91vmzAQ%2F1cs%2BkJURpbuYRr9kNIEqdXaUIVsL0uFHHDAmjlb2DTrIva37wz5mkalwgO%2B%2B33cHRxbJ5VgGBgnID%2B2jnlVDE%2BYFHUJjkfegkslwaa9k2BGyx2asTDjRlb%2FwLGhxuJbh2f4GCEmKOSt4vzcUrWsq7S1OONryNia3EZRvEiip3D2GC7uomkSzsa3D2Ey%2FzZb3D%2BGyeQunHyNl3CGZA7s%2FXwGGV8vAU8cUlFnjFwVxigdDIcrKTX2nvs5N0W98rkcSsWgZKaQWYeeJPxCqRtrVGsOOQF8B1rRlJGWGARH5qVlaVPVqSFj4CUVZLsEgtcLr0yN4Z8u7Q7INcGBaC0MiprLg2wqcxIcxE3r%2BN%2FIk4dxHIex29E8Kxr0Ml0lfzKPuLvyiTLVVSe6GXjkRfKsX5dE38P5%2FH4a9hlgtYN6P99wSHzfx0msGwdDSsrBPYU5cMOp4L8ZpguqCUhDVowBSakQLOuIdnwNUqrXtq%2Bdlq5kZTTZ4NcirKpkRfATaJqzoHU5Wu9cbNNuZ2Pnw6acpvHIe7eb%2FWJp%2FfZuH3a4Z78tnQtWtSmLXXwafbSA4Cvd%2FWGwq9Juj4VeOvroy4XTPGMsleESLNv5oE12jdajz0dzatEnCkzEhdwA0tZUaHZSPKrNHsKlsgitct0rQX%2Feb7apqNqHTfOM91%2BRGWsy[Compiler Explorer^] [source,c++] ---- @@ -1866,7 +1866,7 @@ Error type: cpp:final_error[]. cpp:final_virtual_ptr[] takes the static type of its argument for its dynamic type, without checking it, unless runtime checks are enabled: -*Example* - link:https://godbolt.org/clientstate/eNqlU1FvmzAQ%2FisnKk1EzWDpHqaRplKaIrVaG6Yk68tSIQccchrYCJt0WZT99p2BELTmYdLgAfzdfd%2F5zv72luJKoRTK8uD73sKYvoM%2BWCkTSckSTksrury0CFKyLKIKuMC1iPkaboNgvgiDr%2F70yV%2FcB3ehPx3fPvrh7Nt08fDkh5N7f%2FJlvhQXlIyC%2F3s%2BFzGul4L%2BUERpGXO43midK891V1IqLYvESVBvypWD0pU5FxnXGxnX0Q7gbPL85v9lXBSokaX4izeKS1EqFAkIlnGVs4hDxfG8E2lospQuykjDWGDGUtgvBdCzxUKXtPxdw3YPRkAjYmWqiXQYtrQ7mYDXkg%2BV4pshTh7H87k%2Ft%2Bu0viH1zmbaufzB%2B2A35cNcF9c16abXh63E%2BDwvDJ792ezhzj8nQNVa9rE%2F1wXHcagTo4ZCQ8ZQ2G34NEy7LmhA06oSUua7YQ3UO3sHrO5%2BdIq2RdhKFlrBKx0h8KKQBdBhKLq1XpuCYkuVYohYmoKWQPeQxCLZTNgDpZnGCPQu51TjOMN4Rwd7gmlztaIZgF1phJ0h2PUee6Yb6tmYJZJZjikvKl%2B9EMB%2F8qikG9cY7RinVeM6KzKeu%2Fo4%2BGD4Ka66lrSq22UCW9Ikvxps8PnKOhhtmevGwtZ7peMRGXbwyTp0tvGMClepMe%2BapYp3IkGp81Kf4jQWE2ZFUmZc6ErU6gJvpagkimNetfgr5%2FBC7x%2BvYHrz[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqlVF9v2jAQ%2FyqnVJqCymB0D9NCqURppFZrSUXYXkYVmcQEa%2BEcxQ6Moeyz7xxDYBqVKi08JL7fn%2FOdfeycWKLmqB0Pvu8cvc05fVEwK1fotOE1eJVLNOH2yWLMVns04X4itCz%2BgkPNtMF3jkjo1SMsY5jWistLQ1WyLOLa4kIsMOELuA2CcBoFz%2F74yZ%2FeB3eRPx7ePvrR5Ot4%2BvDkR6N7f%2FQlnOEFkQXyt%2FM5JmIxQ%2FoSGGdlwuF6qXWuvG53LqWivaedVOhlOe8I2ZU5xxXXS5lY9CTQWeb5zf%2FbdAUKLVgmfvG94wxLJTAFpK6qnMUcao3nHUV9w1K6KGMNQxQrlsFuhkDPWhS6pOVvG3ZbMABqESszTaKq38juZApeI65qx3%2BaOHochqEfupbWNqLWWaabyx%2B8De4%2BfZTr4tqKblptWEuRnNdFwTd%2FMnm4888ZULZGfaiv24VOp0OVGDeBGlZMoNvAx2a6NqEJmlIVSplv%2BzZgd%2FYOmK1%2BcESbJGwuC61gQ0cIvChkAXQYiqXcaygC15QpgZhlGWgJdA%2FJjMbGdtgDRfdexGBmh3Icephs6WCPYdqcdTQNcGuP6KQJrt1jy1RDNTtV1Ya3jiP%2FyePy9WFshu7MQBq6yHhRhwx29bH3wQCZmCv7l4D7LPXlNNDa0nufr5zqhdYy14KaYWLvlU4GZN37dDRnBn1myLNwKTdItAXLFD9JHpT6AFFHDcKKVJ2VkL84b7YpWH5YVtUL%2Ff4A%2F1qqoQ%3D%3D[Compiler Explorer^] [source,c++] ---- @@ -1942,7 +1942,7 @@ With the default limits, the first three are unlikely with ordinary type ids, and cannot be provoked by a small program. The last two policies take their limits as template arguments, so it takes a registry configured to fail: -*Example* - link:https://godbolt.org/clientstate/eNqtU9tu00AQ%2FZXR8pKqaZwEUFU3jVRoJB6AIKXihVTRZr2xR1rvrvZSKJH5dmadmxV4A%2FvB3jNzzlx2Zsu89B6N9iyHb1uGBX1HfWCK6zLyUtKRictLRpA30YkWeIVaqFhImFQhWJ9n2doYH4wrByWGKq4HaDJjpa5lqEyxs3aAQWXtdKn%2FVSazRqFA6bMaNdZcrax0GynCquK%2B%2Bl9BSDogV%2FhT7hW7mj441GULRk9%2FoHktveVCQiuU5yel2%2BRFhCgC3Lf5wnapgZ5ndCHS8dcO7l3AHRRyw6MKRGpuj7QHU0J%2BJDddxVSyLFZOlkjIy044P8gc8Tz%2FTlVPDp3L87%2B1bvKmDzdv%2BzCcTg9R3s3ni8fV%2FMvs86fZ44f5w%2Br9x%2FvFYrbo7ZLpp9T650lctFTUAWqOmsra15tlwNfGBQ8pGZDOGQfUN08Dlx9dhImqAG0CWJUaOobwYiVg4YFvgnRAEVLLh1BThWgVSud37NOdTc5SmvZSUs1Sp4kWpraoiJWG%2F4kA%2BUOKSLOx34aDnU771WAiLcb49WiY%2BArX3b1h7ZUnwzNp0lIlbHQzZk3SNjbs94xd%2BVDc0VaNrlnTSeMrelyrtGEbrrzsWOYx2BhOdrryZOaujLXUoRVlXeBPKQqJ%2BuDXHs58mid6fwPspmpF[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqtU9tq20AQ%2FZVBfXGIatluS4niGNLG0Ic2DjhvdTBraSwtrHaX3VHS1Kjf3lnJtwYHCq30oJ05c85ctLOJMqMJNUUpfN9E9GyRT%2BxUdaWjGF6DK2t0cMdHxq2otmiO01yScX%2FAcxIU8E0kc%2F4MGVNCFy3j%2FDyEelO7rJV4I3Wm6hxhXBJZnybJyhjPikW%2FkFTWq740ibGoK6TS5B165OiX1k4W%2Bl9lEmuUzCT6pJJaVkItLbo1ZrQshS%2F%2FVxKWJimU%2FIlbxWNNT07qonXWnk%2BgecreigyhFUrTg9JliGJCnRFct%2FXCZqGBn0fpqGbzV%2BfuncEV5LgWtSImNZd72o0pIN2Tm2PF0DLmS4eFZM9zJ5zuZPb%2BNH3irse7yaXpqdGN38dw8SGGwWSyy%2FJpNpvfL2d309tv0%2Fsvs5vl56%2FX8%2Fl03uuKiUNp8csizlqq1ASVkJrb2vabJCBWxpGHUAygc8YBz82LAtN9SGZqlYM2BFaFgY4gXHCQuQexJnTAGcLIB1Bxh9Iqic537MM%2FG78oadILRTULHTVNDH%2B7M%2FgDs%2Fr1jdlvxomtCeFSoWtdARu9Gw4CoOTKd3urt1naGxOgxy58eDGKmge2jSVpdIiO3nrKr1h6%2BPEgLgJ6JzSqeWmeNIethfJ4lHxW0w7i2xIQ4Qp%2FksL68rTYkxN2ZzbNA7%2B%2FAdt5mfM%3D[Compiler Explorer^] [source,c++] ---- @@ -1951,7 +1951,7 @@ include::example$snippets/errors_hash_search.cpp[tag=classes] include::example$snippets/errors_hash_search.cpp[tag=init,indent=0] ---- -*Example* - link:https://godbolt.org/clientstate/eNqtU01v2kAQ%2FSuj7YUoBAM9VN0QpLRB6qEtlYh6KRFa24M9kr1r7UfSNCK%2FvbPGgBWOLT7gfTPvzcx63otw6BwZ7YSEXy%2BCcv6fDEFUShdBFchHkV1eCoacCTZrgXeksyrkCLPS%2B8bJJEmNcd7YYlSQL0M6IpOYBnWNvjT5PtoDRmXTzNf6X2WSxlSUEbqkJk21qjaZeUS7KZUr%2F1cJFvakKvqDnWJf03lLumjB4PgNtKrRNSpDaIWkPCldxywmhMzDbdstvKw18O%2BRrA98fN3Dgwu4gRy3KlSeSbvrI%2B3OFCCP5F1fsR0c843Fghh63ivLg84Rl%2FKJx54dLk7K85ubjefzg%2Fqn5XJ1v1n%2BWHz%2Ftrj%2FsrzbfP56u1otVoN9E8PY0vCs%2BEXLJe2hVqR5nm7QJAGVGusdxCYArTUW%2BMIc75k8pvgSwbF4hc5DSt1sYLYwBf%2FcIFDugBxMYjBK5TiE2lhkptItfQxMN0%2BY70VP33D2ttX5IDa7W%2Bu44JmpG6rQtl54YAB%2FYxZ4WTpzHOJ86pwisuiT6fvJOPIrSvs2Eu0OxADXjB6L2OTjVOyitml8Zztx5Xx%2BwyabfICrOq2JM3rd%2FCRHaRV9t1WVw15kGXwT%2FCnOqxDDyhahRu1bbdEHzqW4MulDXnt4k7N74Ocv7pJyCg%3D%3D[Compiler Explorer^] +*Example* - link:https://godbolt.org/clientstate/eNqtU01v2zAM%2FSuEd0nRNE6ywzA3DdCtAXbYmgLubSkC2WZsArJkSHKyLnB%2F%2Byg7X1tTYMBmHyzy8T1%2BWNwGqVYOlQsi%2BL4N3HOFfGKnrEsV9OEtuKy08u7%2BiXEvyh2a4Swjp81vcOyE8%2Fg2oIw%2FI8akUHnLuLz0oVbXJm0l3pFKZZ0hTArnKhuFYaK1ZcV8kJMr6mRAOtQVqhJdobMOPXEMiqqaLtS%2FyoSVlpQS2rAkRaWQy1Sv0SwLYYv%2FlYKFHQlJP3GneKppnSGVt87a8gkUz9hWIkVohaLoqHTto5hQpw5u22phu1DAz5qMq9l86dy9C7iBDFeilo5JzfWBdqdziA7k5lSxbRyzpcGc2PXcKUd7nYM%2Fijbc9mQ%2FuCh6PbnJcDrdq3%2Baz%2BPH5fxhdv9t9vhlfrf8%2FPU2jmdxryui70vqv0p%2B0XJJOSgFKe5n12gYgki0cRZ8EYDGaAM8MCtyjA4hrkCwLC7ROkho1xvoFYzB33CgzAJZGHnQS2XYh1IbZKZQLX0ITNcbzDrR4z%2Bc%2FFnqtOeLbRYqaJo%2B%2FO0K4Q9M67cX6LAoZ5bIh5NE07o8Nn4%2FGnpAUmK7NVa7LO0V8tC6Cx99HAfNE9u6cqSVjw6urMtuWHr0Aa7KpKTxMYfwQQ9CoYwLvVEcvRLS4kkN89rtIb5FHhEmt2cpnIbOi22MqPZm0zzx%2BwsIIqG4[Compiler Explorer^] [source,c++] ----