Examples like these do little to help the idea that AI is just a tool for beginners - especially in a language like C++, where the code it generates it clearly junior-level code.
Neither provides a 100% working solution out of the box, but I'd rather argue with ChatGPT about a library it hallucinated than dal with the egomaniacs that exist solely to lock threads on StackOverflow.