[libc-commits] [libc] [libc] Template the writing mode for the writer class (PR #111559)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Tue Mar 11 10:50:24 PDT 2025
https://github.com/michaelrj-google commented:
A brief explanation for anyone curious: I talked with Joseph about a new idea I had for templating the scanf reader which I think will work better than templating on an enum and having `if constexpr`s for each option. My new design focuses on templating the reader/writer on a class which provides static methods for handling a filled/emptied buffer. This allows for straightforward static dispatch without needing to pull in the dependencies for every option. Dynamic dispatch would be handled by an indirection reader/writer that holds an enum+union or void* for the specific reader/writer.
I'm planning to move to that design in the future, but I'd prefer not to block the GPU runtime more than I have to so this patch may end up landing mostly as is, with a refactoring coming later.
https://github.com/llvm/llvm-project/pull/111559
More information about the libc-commits
mailing list