-7

About 10 years ago I posted a question to Stack Overflow. Recently, it was marked as a duplicate.

The problem is that the question is not a duplicate of that other question. I'm being instructed to change my question to highlight why it is not a duplicate. The question is very straightforward as it stands and was answered well. The other question is related, but it requires a different approach.

My problem is that both questions add value to the community. Changing my original question to highlight the difference will add a clutter for it. There should be a way to explain the difference without modifying the question itself.

Just to explain it here. Both questions are asking how to exclude some variants of the function overload in C++. The other question is asking for a straightforward usage for std::enable_if. My question is a specialised case of the class constructor. And as you can see, no answer to my question is using std::enable_if as a simple template parameter, which is the solution on the other question.

9
  • 3
    Under your question, post a comment and ping the sole close voter that «hammered» your question, and explain. Commented Sep 14, 2023 at 6:58
  • 7
    if it's already very clear why it's not a duplicate, do nothing. If it's not very clear, help everyone out (especially future searchers) by making it clear. Disambiguation is not clutter.
    – starball
    Commented Sep 14, 2023 at 7:14
  • 2
    So... 10 years ago you got your question answered. It even got an updated answer a few times. Even if the closure was wrong (and I am not yet saying it is), you sustained no harm. Commented Sep 14, 2023 at 7:23
  • 7
    "And as you can see no answer to my question is using std::enable_if as a simple template parameter" I'm not an SME, but because different solutions are used in another question doesn't make it not a duplicate (candidate). That's part of the reason why questions are closed as duplicates; so that all the different methods can be shown in a single place, not in many places.
    – Thom A
    Commented Sep 14, 2023 at 8:10
  • 6
    I believe you can cast a reopen vote even if you don't make any changes to the question, but I'm not sure. Commented Sep 14, 2023 at 8:59
  • There is a way to potentially reject a duplicate closure, by editing your question, to indicate exactly the reason the answer to the duplicate does not answer your question. In your case it does. Commented Sep 14, 2023 at 10:48
  • 4
    "There should be a way to explain the difference without modifying the question itself." - that is something I do agree with. Or rather worded as: To explain something is NOT a duplicate should at no point involve editing the question as it is essentially adding meta data, fluff. There is no facility for doing that, so the only thing you can do is abuse the comments for it. It is not your fault that this specific process is not very well supported by the UI.
    – Gimby
    Commented Sep 14, 2023 at 10:57
  • 2
    You say: " want to selectively define constructor A::A(int) only for some types using enable_if." In other words, to use std::enable_if to conditionally (only for some times) compile (define, in such a way that the compiler recognizes it) the constructor .The target is titled: "std::enable_if to conditionally compile a member function", and that seems to accurately describe what the question is about. Just to make sure: you understand that constructors are considered a kind of member function in the Standard? So then how is it not a duplicate? Commented Sep 14, 2023 at 22:46
  • 1
    More importantly: did you try the advice there? Does it solve the problem? If not, specifically how did you try to apply that answer; what happened as a result and how is that different from what you expect? Commented Sep 14, 2023 at 22:46

1 Answer 1

12

I have closed your question as a duplicate because it is one, albeit not an exact duplicate. In your question, you are attempting to use std::enable_if to conditionally compile a constructor:

template <class = typename std::enable_if<T::value>::type>
A(int n) : val(n) {};

[...] I want to selectively define constructor A::A(int) only for some types using enable_if.

This is exactly the goal of the linked question std::enable_if to conditionally compile a member function. Note that a constructor is a member function (namely a special member function).

Obviously, your code isn't 100% identical to that in the linked question, and your question is worded differently. However, the general problem is the same and the answers in the linked question could be used to answer your question as well.

The standard for whether something is a duplicate isn't "Is this verbatim the same question as another one?", the standard is "Do answers elsewhere answer this question too?".

Related posts

Why bother closing old questions as duplicates?

I have recently been closing a high volume of old questions as duplicates, editing their titles to make them more discoverable, adding tags, etc.

The reason is purely to improve cataloging. There are many Q&As which have been duplicates from the start, or which have become duplicates over time because a more recent question with the same problem and better answers emerged.

Closing old Q&As guides recent website visitors towards what the "canonical" Q&A is, where the best solutions to the topic can be found. It is ultimately harmful to the community if good answers are difficult to find, and fragmenting good answers over 2-3 Q&As with the same issue makes that a lot harder.

What can I do if I believe my question is not a duplicate?

One of the related posts already answers that question. I believe you can cast a reopen vote with no changes to the question, and if the community believes that your question is not a duplicate, it will simply be reopened.

5
  • 1
    Stack Overflow would not scale well if all duplicates had to be exact, 1:1 matches. Commented Sep 14, 2023 at 18:21
  • @user4581301 it doesn't scale well even though duplicates are allowed to be fairly imprecise. There are nowhere near enough person-hours put into looking for and closing duplicates, and the asker-oriented strategy for soliciting questions means that many similar, overlapping things get asked where only a few might be needed to "cover the problem space" properly. Commented Sep 14, 2023 at 22:48
  • Perhaps we can reduce the search time required by erasing Stack Overflow and starting over every few months. This would prevent cruft from building up. Real shame about all of the good questions and answers though... Commented Sep 14, 2023 at 23:14
  • @user4581301 That would kind of defeat the entire point of the duplicate process. Maybe if we were considering things that radical we should require reputation to be able to ask a question. Commented Sep 15, 2023 at 21:36
  • That's a better option than my usual "Thanos was right!" approach. Commented Sep 15, 2023 at 21:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .