Take care when using comma in C++
A friend had a weird bug while working in C++ last week. As sometimes it’s required he had to convert a string to an integer and instead of writing: auto result = (SomeEnum) (stoi(s, nullptr, 10)); He wrote this: auto result = (SomeEnum) (stoi(s, nullptr), 10); Such a simple case of misplaced parenthesis caused the … Continue reading Take care when using comma in C++