Calling code w/o headers...
summary
Shows a concrete way to call a function from a library header you do not have at compile time by exploiting delayed template instantiation and ADL: declare a template that defers the call, then add a tiny namespace monorail helper that forces argument deduction so lookup finds MonorailHash regardless of include order. Tests reveal MSVC accepts the naive variant but Clang/GCC need the helper; the hack works across include orders and avoids changing callers.
AI-written summary · about
chapters (5)
- 0:00Start
- 0:10The obvious solution
- 1:19If you don't mind modifying callers...
- 1:50Delayed template instantiation to the rescue!
- 2:15Delayed template instantiation to the rescue, 3
related talks
01h 00mBack to the basics: Namespaces 101
01h 02mBack to Basics: Function Call Resolution in C++
32mAHA Programming
01h 03mObjects? No Thanks!
01h 05mThe Imperatives Must Go!
06mLightning Talk: Cute Approach for Polymorphism in C++
01h 07mDependency Injection Patterns: Efficiency and Usability
03mLightning Talk: Dependency Injection for Modern C++
