Two questions are duplicate pretty much when they have the same answers.
- Note that I wrote “the same answers”, not “the same answer”. You have to look at the answers as a whole. Just because there's one particular solution that works for two problems doesn't mean they are the same problem. But if every solution to either problem is also a solution to the other problem, then the problems are the same.
- Note that an answer is not just the TL,DR version, it's the whole answer, including explanations. Just because you're using the same tool for two different tasks doesn't mean they're the same task. But if you're using the same tool in exactly the same way, then the tasks are to all intents and purposes identical.
For the two questions you cite, it looks to me (I'm not a C++ expert) like these are different questions, with different answers. Nawaz's answer based on a particular paragraph in the C++ standard is relevant to both, but it's not the whole story; for example Als's answer looks suitable for only one of the two questions.
Or to take another example from Kaestur Hakarl cited by Grace Note in a related thread:
I asked for an atomic UNIX operation on unix.se, and got the answer I was looking for - mkdir
. It would be ridiculous if a question about how to create folders got closed as a duplicate of mine!
Here mkdir
is one tool for the job in both cases, but it's not the only possible atomic operation, and the reason why mkdir
is suitable (which is part of the answer) is different in both cases. So “what utility exposes an atomic operation” and “how to create directory” have a part of an answer in common, but they don't have the same answers, they're not the same questions.