Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I was browsing in my old questions and I noticed that long time ago I asked a question about how linking a C++ class using templates. Indeed it seems like if you use templates you can't put the methods in a cpp file otherwise you get linker errors.

This was the question, but they all intended it like I wasn't able to link a header and got a lot of "get yourself a book" comments. Now this wasn't the case, I was programming for over a year and I already did know how to link files, and also very more advanced things. But I did not know about templates that had to go in the header file.

The question is here:

Linking a .cpp file containing a class using templates

Now the question is old, but I fell like who reads it is getting it in another way from how I meant it. I would reopen it to self answer it.

share|improve this question
<ot>Your question is strange. The error message you state is "List is not in scope" - that's not a linker message, it's a compiler message. And your question as it was, without the List template, deserved to be closed & answered as it was. If you want it re-open, at lease put the right error message in the post. – Mat Jan 16 '13 at 14:04
But notice that I provided a link to the full code. – Ramy Al Zuhouri Jan 16 '13 at 14:26
I didn't notice and people shouldn't have to go through a link to understand your question. (Fine for additional/not-quite-necessary-but-nice-to-have-maybe information though.) Even with the full code, your title is inconsistent with the error message you had (liner vs compiler error). – Mat Jan 16 '13 at 14:29
I sincerely don't remember the full error. – Ramy Al Zuhouri Jan 16 '13 at 14:34
However what I was doing shouldn't have caused an error If I wasn't using templates. – Ramy Al Zuhouri Jan 16 '13 at 15:07
Depends on what the real error message was. If it was a "not in scope" error, then that's not usually directly template-related - it's a plain missing declaration problem. If it was a linker error ("unresolved symbol" generally), then it could have been template-related and then you found the right duplicate. Exact error messages are crucial. – Mat Jan 16 '13 at 15:24
@WishtobeNothing I don't think this is the case. – Ramy Al Zuhouri Jan 16 '13 at 20:07
up vote 6 down vote accepted

I'm one of those voting to close. Probably didn't look at the linked code, but just read the question.

The way you presented the code in the question, it doesn't get the error you say it does. That's likely why it was closed as Not a real question.

If you had presented the whole case - declaration in the header, template implementation in the .cpp file - it would instead have been closed as a duplicate of one of several similar questions, like this one:

Why do I get "unresolved external symbol" errors when using templates?

So there is not much reason to open the question again, even if it was closed for the wrong reason.

share|improve this answer

A question should be reopened if you edited it and fixed its quality. When users voted your question to be closed this indicated that something is wrong with the way it is put or the problem it tries to solve. So unless you have edited to changed your question to improve it I doubt it will be reopened.

However a question's age should not matter. If you have improved your question it can and will be reopened even long after it has been closed.

share|improve this answer
The question quality was ok, just it was misunderstood so I changed the title to describe the problem in a better way. – Ramy Al Zuhouri Jan 16 '13 at 13:57
@RamyAlZuhouri - the question quality was not OK if it was misunderstood and you had to change the title. – ChrisF Jan 16 '13 at 14:07

The age of a question has no bearing on whether or not it should be closed or not. If the question is appropriate and doesn't meet the current guidelines for closing a question then it should be reopened. As guidelines change over time it's possible for questions that used to be on topic to need closing, or for questions that were once on-topic to require reopening.

Next, just because you want to provide an answer yourself doesn't mean the question should be reopened. Whether or not an answer exists, or whether or not you know it, doesn't affect the quality of the question. Either it's an appropriate question that should be opened, or it's not. Note that if it's not an appropriate question you can attempt to edit it to improve the problems that resulted in it being closed.

Also note that it is inappropriate to edit the answer into the question, especially to try to get around the fact that the question is closed. I have therefore rolled back your edit in which you added the answer to the question.

share|improve this answer

You must log in to answer this question.

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