leftibot 67c98814d2 Fix #339: Prevent implicit move from lvalue references during dispatch
Cast_Helper_Inner<T&&> unconditionally called std::move() on the underlying
object, even when the Boxed_Value held an lvalue reference (is_ref() == true).
This caused T&& overloads to win over const T& overloads for objects returned
by reference, silently moving from and destroying persistent objects. The fix
rejects the T&& cast for reference Boxed_Values, allowing dispatch to fall
through to the correct const T& overload.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 19:47:57 -06:00
..
chaiscript Fix #339: Prevent implicit move from lvalue references during dispatch 2026-04-13 19:47:57 -06:00