Hacker News new | ask | show | jobs
by xodjmk 1076 days ago
Out of curiosity, I took a simple C++ template from my code and used the following prompt with chatGPT3:

Write a non-template C++ function using uint16_t to replace the following function: < copy & paste my template >

It worked, though I would never use the code it generated as is or without verifying.

Will this help with a large codebase?? As an alternative way of thinking, if the codebase really used templates correctly, the codebase should be simpler and less complex. If you study and understand one function generating template, then you should understand how this template will work for all cases. But I realize that's the ideal, and templates can get buckwild.