25

In composing a question just now, I'm referring to the C++11 standard but I am not referring to anything I believe to be new features. Should I tag the question C++11?

I expect that most users will expect the C++11 tag to refer to new features added in C++11. My question will explicitly reference the C++11 standard simply because it is convenient to reference a single document, especially when using section numbering.

In cases where I'm asking questions about the C++11 standard, when should I tag as C++, when should I only tag as C++11, and when should I tag as both? As a responsible question asker, am I obliged to determine if the relevant portion of the C++ standard has changed?

To be honest I simply don't have a great sense of what is appropriate tag-etiquette - some of them are just so broad - but this specific question has crossed my mind more than once so I thought it was worth asking.

7
  • 32
    I have the feeling at least here we have reached a point where it might make more sense to tag with [c++98] since not being able to use C++11 is the important caveat. Commented Sep 21, 2014 at 8:36
  • 5
    Tag it with the highest version you can use, and mention specifics in the question. Commented Sep 21, 2014 at 10:33
  • @Deduplicator I don't agree. That someone can't use C++11 is an important fact. Also, your suggestion might imply tagging many C questions with a C++ tag. Commented Sep 21, 2014 at 14:36
  • 5
    @MatthewLundberg: Since when is C++ a higher version of C? Commented Sep 21, 2014 at 14:36
  • @Deduplicator That's my point. C++ is not a superset of C, but most C code will compile under a C++11 compiler. Commented Sep 21, 2014 at 14:37
  • @MatthewLundberg: I disagree with that being a likely interpretation of what I said, but it seems we won't get anywhere. Commented Sep 21, 2014 at 20:06
  • 2
    @Deduplicator related to Should the “c++” tag start to imply C++11 by default?. Commented Sep 22, 2014 at 1:54

4 Answers 4

31

... Should I tag the question C++11?

Tag it as c++. It doesn't really matter which version of the standard you take; your question is valid in all of them (isn't it?).

You may think of c++11 as "the default version of the standard", but it isn't. Suppose someone reads your post in 2019, and wonders "what does this have to do with that ancient 2011 version?" - so the "11" part is just distracting.

Also, would it be right to edit c++11 into e.g. c++14 when the new standard appears? No, this is pointless.

... when should I tag as C++, when should I only tag as C++11, and when should I tag as both?

If the answer to the question is different in c++11 and c++03, tag it as c++11. I think you must also add the c++ tag in order to make your question visible to people that watch the c++ tag but not the c++11 one (there was a proposal to make tags hierarchical, but I guess it was not implemented yet).

11
  • 10
    "You may think of c++11 as "the default version of the standard", but it isn't." - I still think of C++ 03 as the default. C++11 is just something that causes IDE errors and compile failures (plus it adds some new features).
    – jww
    Commented Sep 21, 2014 at 17:45
  • The proposal for some kind of tag-hierarchy, and similar additional semantics for tag, is often proposed and at least as often ignored or declined. Seems your example didn't get an official status-tag yet... Commented Sep 21, 2014 at 20:09
  • 1
    In a matter of a few months, C++14 will be the current version of the standard, and within a year or so, it will be the default version because most of the mainstream compilers already have C++14 support available. Commented Sep 21, 2014 at 22:22
  • 3
    Soon the question will be "should I tag as C++, C++11, C++14, and C++17?". Commented Sep 22, 2014 at 2:00
  • @JonathanLeffler: default for whom ? I am still stuck with gcc.4.3.2 here... The enterprise world moves slowly... Commented Sep 23, 2014 at 15:05
  • @jww, actually C++14 is "the default version of the standard" now. Go check with WG21, they'll agree.
    – Griwes
    Commented Sep 23, 2014 at 15:34
  • @Griwes - I think its wishful thinking by the committee. Its hard to call something default when it breaks the toolchain and its not fully implemented in compilers :) See, for example, C++1y/C++14 Support in GCC.
    – jww
    Commented Sep 23, 2014 at 15:58
  • @MatthieuM. Some parts of the enterprise world move slowly; others move more swiftly. Yes, there are always laggards. Commented Sep 23, 2014 at 16:17
  • 1
    We are still waiting on MSVC to implement the C++11 standard. It's going to be a sad joke in a few months when C++14 is out. Too bad they spent so much time uglifying the IDE instead of improving the compiler. And let's not even talk about how far their optimizer is behind GCC's.
    – Cody Gray Mod
    Commented Sep 23, 2014 at 17:09
  • @jww, a complete implementation of C++14 exists, hence it's the default. It's the latest revision of the ISO 14882, hence it's the default, because it's the ISO 14882 that defines what "C++" is.
    – Griwes
    Commented Sep 23, 2014 at 20:31
  • @CodyGray, to talk about implementing C++11 standard, you'd first have to have them implement all the (still existing in the standard...) parts of C++98.
    – Griwes
    Commented Sep 23, 2014 at 20:32
9

I don't see a problem. Tag your question . If it is about something that has appeared or changed in C++11, add as well.

9

You should always tag C++ questions with the main tag. This is the tag that people interested in C++ programming use to find your question. So if you exclude it, your question will get much less attention and less answers. Also, this tag is associated with a certain syntax highlighting on the SO site, so by labelling your question , you'll get your code highlighted in an appropriate way for C++.

C++11, C++03 etc are for questions that are specific to these versions of the standard. So you'll probably know when to use these tags, it is common sense.

Be aware however, that C++11 is the current ISO standard and if you only tag your question , then it is implicitly assumed you are using C++11. So if you are using an older compiler which does not support C++11, you should tag your question with the old version of the standard, indicating that you are only interested in answers that apply to that specific version.


Actually, how to use the tags is mentioned in the information wiki for each C++xx tag:

"Please tag questions about C++xx with the c++ tag, along with the c++xx tag."

Both C++11 and C++14 had this line in the wiki, but the C++98 and C++03 tags did not. I have now added the same line for the latter two.

4

I would prefer you to tag your question with the most modern version of the standard you are working on, and your code has to work in.

In the case that you need code that works under multiple standards (say, you are writing a library that needs to support C++03, C++11 and C++14), usually tagging the oldest standard is enough, unless you also want to make your code future-proofed for a later standard (as an example, "how can I make this class C++03 compatible, yet enable move optimizations for C++11 compilers?" might be such a question)

On the other hand, if you don't tag your question C++11, I'd assume you are working in C++11 at this point. So dropping it isn't all that crucial. Shortly, the same may be true of C++14, C++17, and C++2102.

3
  • Oh dear god, I hope we aren't still using C++ in 2102.
    – skrrgwasme
    Commented Sep 22, 2014 at 22:17
  • 2
    @Slawson it is actually short for 32102 -- nobody uses the first digit. Commented Sep 23, 2014 at 0:19
  • ... Well that's enough making a fool of myself for one day. Check back tomorrow for the next show!
    – skrrgwasme
    Commented Sep 23, 2014 at 2:07

You must log in to answer this question.

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