leftibot 255ff87f37
Fix #405: push_back() on script-created vector has no effect if vector_conversion is in effect (#663)
* Fix #405: push_back() on script-created vector has no effect with vector_conversion

When both vector_type<T> and vector_conversion<T> are registered, the
dispatch scoring treats all parameter mismatches equally. This causes
the C++ push_back (for the converted type) to be selected over the
built-in one when both have the same number of type differences. The
converted function operates on a temporary copy of the vector, silently
discarding the mutation. The fix deprioritizes overloads that require
type conversion on the first parameter (the object/receiver), ensuring
functions matching the receiver type exactly are always tried first.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Address review: remove issue references from comments, add round-trip conversion tests

Requested by @lefticus in PR #663 review.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: leftibot <leftibot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 15:45:22 -06:00
..
dispatchkit Fix #405: push_back() on script-created vector has no effect if vector_conversion is in effect (#663) 2026-04-11 15:45:22 -06:00
language Fix #607: Remove unnecessary forward declarations that cause C++20 build failures (#647) 2026-04-11 13:42:40 -06:00
utility Fix #477: Handle \u unicode escape sequences in JSON parser 2026-04-10 19:49:48 -06:00
chaiscript_basic.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
chaiscript_defines.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
chaiscript_stdlib.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
chaiscript_threading.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
chaiscript.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00