leftibot 047e41ca40 Address review: expand string_view binding with substr/find/[]
Adds substr, find/rfind/find_first_of/find_last_of/find_first_not_of/
find_last_not_of, starts_with/ends_with, and operator[] to string_view_type,
mirroring string_type's search/substring surface so script authors can
traverse a buffer through string_view without allocating.

Sharing method names with string_type creates an ambiguity in
dispatch_with_conversions when the script call needs arithmetic conversion
(e.g. myString.substr(int, int)): both string::substr and string_view::substr
match-except-for-arithmetic, and the existing const/non-const tiebreaker
doesn't apply. Extend dispatch_with_conversions to prefer the candidate
whose first/receiver parameter type exactly matches the actual receiver,
mirroring the deprioritization already in dispatch(). With this in place,
myString.substr(1, 2) still resolves to string::substr while
mySV.substr(1, 2) resolves to string_view::substr (returning a string_view).

Updates the doc comment on string_view_type and adds a compiled test that
locks in both dispatch directions plus the new search/substring methods.

Requested by @lefticus in PR #697 review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 11:18:19 -06:00
..
dispatchkit Address review: expand string_view binding with substr/find/[] 2026-05-02 11:18:19 -06:00
language 🎨 Committing clang-format changes 2026-04-29 02:22:59 +00:00
utility 🎨 Committing clang-format changes 2026-04-29 02:22:59 +00: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 Define _LIBCPP_DISABLE_AVAILABILITY for MacOSX (#695) 2026-04-28 20:12:22 -06:00
chaiscript_stdlib.hpp Fix #458: Support std::string_view interop with ChaiScript strings 2026-04-28 20:48:30 -06:00
chaiscript_threading.hpp change .clang-format and reformat code with clang-format 11 2021-05-24 10:44:15 +02:00
chaiscript.hpp Fix #571: How to redirect "cout" and "print" to a microsoft Windows 10 window? (#657) 2026-04-11 18:58:09 -06:00