tqchen opened a new pull request, #582:
URL: https://github.com/apache/tvm-ffi/pull/582
## Summary
Introduce `tvm::ffi::reflection::overload_cast<Args...>` — a `constexpr`
helper for picking a specific overload of an overloaded callable by spelling
out a parameter-type prefix that uniquely identifies it. Trailing parameter
types (if any) are deduced from the picked overload's signature. The result is
a typed function pointer (member or free) usable wherever a typed fn ptr is
required, including as a non-type template argument.
If the prefix matches multiple overloads, the call is ambiguous and the
caller spells more parameters until exactly one overload matches.
Const-qualified members are picked via the `tvm::ffi::reflection::const_` tag.
Placed in \`tvm::ffi::reflection\` alongside \`AttachFieldFlag\` and other
registration-time helpers.
## Test plan
- [x] New unit tests in \`tests/cpp/test_reflection.cc\` covering:
- Prefix matching (member + free fn) with trailing-arg deduction
- Shared-prefix disambiguation (caller must spell more)
- Const-qualified member via \`const_\` tag
- Use as a non-type template argument
- [x] All 4 \`OverloadCast.*\` tests pass; full \`tvm_ffi_tests\` suite
passes
- [x] \`pre-commit run --all-files\` clean
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]