Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "What does this program print?" on CodeWiki (https://codewiki.com/practice/predict/cpp/namespaces/predict-adl-candidate/).
Context (verbatim from the page):
"""
#include <iostream>
namespace courier {
struct Parcel {};
void dispatch(Parcel) { std::cout << "parcel\n"; }
}
void dispatch(int) { std::cout << "integer\n"; }
int main() {
courier::Parcel parcel;
dispatch(parcel);
dispatch(0);
}
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in cpp. Where you are unsure, say so.