15

When should I use either the tag (of which is a synonym) or ? According to their wiki pages, they refer both to the C++ Standard Library.

If there isn't any difference between these two tags, I would like to request to map one to the other as a synonym.

1
  • 1
    The [stdlib] tag you had originally mentioned doesn't actually exist. It is a synonym that remaps to [std]. I've updated your question along these lines, though, because this is still a good question and a valid point. Jun 26, 2020 at 20:42

2 Answers 2

6

The official name (from the language spec) is the C++ standard library. Symbols that are defined as part of the standard library are included in the std namespace, so it is common for users to refer to it as either of those names, or the much older "Standard Template Library" (or simply ).

I think that should be the main tag, and (along with its synonym ) as synonyms of that tag. (Also, also has better tag info, IMHO.)

3
  • 2
    Tag info shouldn't factor into the decision; I can trivially copy that to whichever tag we decide to make the "master". It's all about what text we want to show up. I agree with you, though, that [c++-standard-library] makes more sense, and that [std] and stdlib] should be merged into it. I guess I'll stop short of merging [stl] into it, too, since that'll surely bring out some pitchfork-bearing pedants... Jun 26, 2020 at 23:24
  • Since no counter-arguments were brought, I am in favor of merging the tags. Do you (or @CodyGray ) want to submit an application? I do not have the necessary privileges for this. Jun 28, 2020 at 11:46
  • You are kind of forgetting that the name stdlib is already taken since the early 1970s, long before C++ was invented... stdlib.h ring a bell?
    – Lundin
    Aug 31, 2020 at 14:16
3

I went through the list of questions tagged and a overwhelming majority is related to , which is fine. However, it looks like there are a lot of questions without C++ to, most evidently:

I don't know much about C/C++ but I have deleted a lot of "no longer needed" comments complaining about how a poster has tagged for a C++ question, so I assume that these need to be disambiguated first before the tags are merged.

Given that there are 227 questions that require our attention first, I think it is better to hold off on this tag merge until the tag is cleaned up and tidied for a merge with .

8
  • At the questions tagged with std and c but not c++* the std tag should be replaced by libc. Those with neither c nor c++* probably need an additional c++ tag. Is it possible to do a bulk edit? Aug 18, 2020 at 8:58
  • @user5534993, there is no bulk editing. We need to check each post and update the tags only once we're sure that it's related to the C++ standard library. There are some cases like these, where it is related to Standard Deviation stackoverflow.com/questions/28290644/… Aug 18, 2020 at 10:24
  • Most importantly, std is a C++ keyword used for the standard library namespace, while stdlib is the name of a C header, which means something else entirely in that context, namely the use of stdlib.h.
    – Lundin
    Aug 31, 2020 at 14:25
  • @Lundin, if that's the case, then [std] and [stdlib] needs to be disambiguated as well, which kinda would be the outcome of this cleanup. The only difference is that, at the start [stdlib] needs to be removed as a synonym for [std]. I would propose calling [stdlib] as [c-stdlib], and rename [std] as [c++-standard-library]. (Feel free to suggest a different name for the C tag) Aug 31, 2020 at 17:58
  • The thing is... std does not mean the "C++ standard library", it means the standard namespace. stdlib.h does not mean the "C standard library", it means one specific sub library of the C standard library. The most sensible name is [stdlib.h] if tags allow dots. That name is understood by C and C++ programmers both.
    – Lundin
    Sep 1, 2020 at 6:51
  • Sure, @Lundin, that should be fine. We do allow dots in tags. As long as we are sure that [stdlib.h] is understood by all, we should be good. Sep 1, 2020 at 8:23
  • @BhargavRao Aye, that's the least ambiguous name you can give it. The .h is understood by C and C++ programmers and should prevent unrelated posts from including it for general "standard library" purposes.
    – Lundin
    Sep 1, 2020 at 8:51
  • stdlib.h is also the name of a C compatibility header which is part of the C++ Standard Library (see C++20 final working draft section D.9). @Lundin do you suggest to create the identically named tag to be applicable for C and C++? Sep 6, 2020 at 17:11

You must log in to answer this question.

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