Langbahn Team – Weltmeisterschaft

Talk:C++11: Difference between revisions

Content deleted Content added
Line 173: Line 173:
::*[[C++0x#Modification to the definition of plain old data|A]]: ''However, the list of rules in C++03 is overly strict.''
::*[[C++0x#Modification to the definition of plain old data|A]]: ''However, the list of rules in C++03 is overly strict.''
::*[[C++0x#Null pointer constant|B]]: As in Mr. Firstresult, the means of achieving a type safe NULL pointer constant and the effects doing so has on the language can be questioned. Such a questioning view is not represented. ᛭ [[User:LokiClock|LokiClock]] ([[User talk:LokiClock|talk]]) 18:06, 17 May 2010 (UTC)
::*[[C++0x#Null pointer constant|B]]: As in Mr. Firstresult, the means of achieving a type safe NULL pointer constant and the effects doing so has on the language can be questioned. Such a questioning view is not represented. ᛭ [[User:LokiClock|LokiClock]] ([[User talk:LokiClock|talk]]) 18:06, 17 May 2010 (UTC)
::I don't have time at the moment for a full scan of the article, and again the main problem is what isn't there, not was is, so I'm gonna tie up my part of this with [[C++0x#Criticisms|a birdfeeder]] if that's alright with you all. ᛭ [[User:LokiClock|LokiClock]] ([[User talk:LokiClock|talk]]) 03:00, 18 May 2010 (UTC)

Revision as of 03:00, 18 May 2010

WikiProject iconComputing Start‑class Mid‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
MidThis article has been rated as Mid-importance on the project's importance scale.
WikiProject iconC/C++ Unassessed High‑importance
WikiProject iconThis article is within the scope of WikiProject C/C++, a collaborative effort to improve the coverage of C and C++ topics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
???This article has not yet received a rating on Wikipedia's content assessment scale.
HighThis article has been rated as High-importance on the importance scale.

C++1x?

I guess you'll all have heard that the new standard is delayed to 2010 or later.[1]

It's funny, I didn't realize until last night that the 0x in C++0x was a partially instantiated year number, like C++93 and so forth. I'd thought it was a reference to C/C++'s syntax for hexadecimal constants, just like the ++ in C++ is a reference to C's increment operator. 70.90.174.101 (talk) 19:02, 23 July 2009 (UTC)[reply]

AFAIK, there's still a couple of months left of '0x, and the current draft is published in '09, and if there's no more changes to that, it would still be '09 even if the ratification and publication dates will be in '10 or even '11. Let's change the name if and when the name is changed. -- Henriok (talk) 23:07, 11 September 2009 (UTC)[reply]

I'm shocked to find that the article has been renamed to C++1x. The inofficial preferred code name is still C++0x even if we have the year 2010 already, see usenet postings by committee members in comp.std.c++. Zerpi (talk) 19:34, 5 January 2010 (UTC)[reply]

The standard is most definitely delayed to 2010 or later. While the per pattern of Windows 95 (ready 1996) they can use all 2010, they will probably not succeed. Suddenly, in the late part of the process, they decide to add a pretty elaborate threads support. Nice, but the standard won't be finished during 2011, and it will take to 2015 till the standard is fully covered in gcc. Rursus dixit. (mbork3!) 18:32, 29 January 2010 (UTC)[reply]
It is quite possible that GCC won't be standards conformant even in 2015. To the best of my knowledge, there are no plans to implement export in gcc (which would bring it closer to C++03 conformance). decltype (talk) 18:38, 29 January 2010 (UTC)[reply]
Byebye "export". Rest in Peace. http://herbsutter.com/2010/03/13/trip-report-march-2010-iso-c-standards-meeting/ --84.179.96.245 (talk) 17:26, 22 March 2010 (UTC)[reply]
Good riddance :) decltype (talk) 17:56, 22 March 2010 (UTC)[reply]

What exactly is the subtract_with_carry PRNG engine?

There is no article on the subtract_with_carry engine. The name looks similar to what is found in a paper by G. Marsaglia and A. Zaman (“add-with-carry” and “subtract-with-borrow”), which is cited by N1452. Can anyone confirm whether the engine really comes from that paper?Kxx (talk) 19:16, 26 January 2010 (UTC)[reply]

According to N1452, a subtract_with_carry engine produces integer random numbers using x(i) = (x(i-s) - x(i-r) - carry(i-1)) mod m; carry(i) = 1 if x(i-s) - x(i-r) - carry(i-1) < 0, else carry(i) = 0. . m, r, and s are constants. decltype (talk) 20:39, 26 January 2010 (UTC)[reply]
It seems that subtract_with_carry as it is in N1452 and N3000 really is Marsaglia and Zaman’s subtract-with-borrow. Maybe we can have an article to explain how the PRNG works.Kxx (talk) 22:28, 26 January 2010 (UTC)[reply]

Collision between UTF-8 and other string literals and string concatenation with macros

What about the following code:

#define u8 "I will be concatenated"
char *s = u8"I'm a UTF-8 string.";

How will this ambiguity be resolved? Icek (talk) 16:59, 1 February 2010 (UTC)[reply]

From looking at the proposal, it will work the way it does for the current L"" strings. A UTF-8 string literal in C++0x is considered a single token. So a UTF-8 string in C++ is not a 'u8' token followed by a string token, but it is a UTF-8 string token. And macro replacement operates at the token level, not by search-and-replace. It's the reason why this is perfectly legitimate C++ code:
#define fo "Not For"
for(;;);
The macro does not affect the token "for". It affects only the token "fo". For the same reason, the macro 'u8' will not affect a UTF-8 string token. Korval (talk) 19:39, 1 February 2010 (UTC)[reply]

Where does n3000.pdf state that a long long int is at least 64 bits?

It seems common parlance that a long long int is defined to be at least 64 bits long on common systems.

But as I grok the current draft, n3000, long long is only defined to be at least as long as a long int, in turn at least as int, etc., as it always was since 1998.

I'll refine that section if nobody will give evidence for a long long being at least 64 bits.

edit: sidenote: Yes, I know that the original proposal n1811 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf) defines a long long as 64+ bits, but it's not in n3000.

Phresnel (talk) 17:05, 3 February 2010 (UTC)[reply]

Like in C++03, the minimum sizes of the integer types can be inferred from the <climits> header. Its contents should be equivalent to its C counterpart, limits.h. The minimum values there require at least 64-bit precision. decltype (talk) 17:43, 3 February 2010 (UTC)[reply]
I see. So we actually have two definitions of the minimum sizes, the one being all in relation to type char (char<=short<=int<=long<=long long), and the other being of absolute, minimum magnitudes (e.g. signed char max >= 127), though the C++ standard does only refer to C, and does not mention the minima itself. Thanks for the pointer. Phresnel (talk) 08:53, 4 February 2010 (UTC)[reply]
That's right. The paper you cite even mentions this fact. "... apparently the only thing that establishes minimum sizes for the integral types in the C++ standard is the requirement that they match the <climits> macro values like INT_MAX ... This is being split off as a separate core issue." Note that C99 also introduced fixed-width integer types, these will be in C++0x as well — An implementation must suitably define typedefs such as int_fast32_t and uint_least64_t. decltype (talk) 09:09, 4 February 2010 (UTC)[reply]

Shouldn't C++1x be mentioned in the main article?

A Google search restricted to en.wikipedia.org for C++1x comes up with C1X ("C1X is the unofficial name of the planned new standard for the C programming language.") and other C references. This is somewhat confusing.

If C++1x was mentioned in the main article search results could be less confusing.

E.g. there could be section that answers the question "If C++0x was supposed to be released/finalised in the period 2000-2009 and this did not happen, why is it still called C++0x, and not C++1x?"

What do you think?

--Mortense (talk) 15:42, 7 February 2010 (UTC)[reply]

Would putting “C++1x” in just cause search results to be even more confusing, considering that some people already use the term to refer to something beyond C++0x (e.g., Bjarne Stroustrup, N2893)? Kxx (talk | contribs) 20:59, 7 February 2010 (UTC)[reply]
C++1x redirects to C++0x here on Wikipedia. So according to Wikipedia C++1x and C++0x are equivalent. It is not primarily the search engines I am concerned about, but more that there is no information about C++1x on Wikipedia. --Mortense (talk) 19:21, 4 March 2010 (UTC)[reply]
Nothing to do about it. We have no control of the Google search engine, which have some annoying quirks regarding searches for non-letter characters. Rursus dixit. (mbork3!) 14:51, 16 February 2010 (UTC)[reply]

Move Transparent Garbage Collection?

Hi, I am too shy to edit, but I think the section about transparent garbage collection should be moved to "Features planned but removed or not included". I missed a heartbeat when I browsed through the TOC and found it there just to get disappointed from the "C++0x will not feature transparent garbage collection directly." ;-) 84.179.112.180 (talk) 20:34, 16 February 2010 (UTC)[reply]

I took it out. If anyone disagrees, feel free to revert. decltype (talk) 06:27, 17 February 2010 (UTC)[reply]

User defined String Literals

I think there is a discrepancy in the text:

 Literals can be extended in both raw and cooked forms, with the exception
 of string literals, which can only be processed in cooked form.
 [...]
 User-defined literals processing the raw form of the literal are defined as follows:
 _
 OutputType operator "" _Suffix(const char *literal_string);
 OutputType someVariable = "1234"_Suffix;
 _
 The second statement executes the code defined by the user-defined literal function. 
 This function is passed "1234" as a C-style string, so it has a null terminator.

If string literals can only be processed in their cooked form, but the example is about the raw form, how does this fit together? I would expect an cooked form example, if just before was sait that there can only be a cooked form. Right?

The Spec says in `[2.14.8.5]` that user-defined-string-literal operators shall have the form `operator "" X(str,len)`. In `[13.5.8.4]` it is said, that the raw literal operator gets `const char*`, like in your example. Thus, `operator ""X(str,len)` must refer to the cooked form. Then, the example, where `"1234"_Suffix` is parsed would be (as mentioned) about the raw form -- and still it has been said, that strings must be processed in cooked form.

confused... —Preceding unsigned comment added by Torsten Will (talk • contribs) 11:30, 2 March 2010 (UTC)[reply]

Pronunciation

I was hoping to find this in the article: How do you pronounce C++0x? Is it "C plus plus ox"/"C plus plus oh ex"/"C plus plus oh nine"? "C plus plus zero nine"? "C plus plus nine"?

Would be cool to have it in the article. Most topics put pronounciation of the lemma in the first sections when it's not obvious. —Preceding unsigned comment added by 134.102.55.227 (talk) 14:09, 4 March 2010 (UTC)[reply]

I've heard several committee members and others pronounce it as "See plus plus oh ex". decltype (talk) 14:16, 4 March 2010 (UTC)[reply]
Thanks, added it!~~----

Evolutionary process?

Programming languages do not use an evolutionary process to develop. Evolution has come to mean that very small accidental changes get selected by spontaneous natural processes, and those "accepted" accumulate in time making up for development on very large timescales. In sharp contrast, in the case of C++ people suggest changes (which are hence not at all accidental), and the Standards Committee selects (so the selection process is not at all spontaneous). If there was no Standards Committee consisting of authoritative people who are in a position to make decisions, C++ would obviously not be the language as we know it today. While biological evolution has been debated ever since it was first conjectured, programming languages obviously do develop, so the parallelism is simply inadequate from this point of view as well. I will reformulate the sentence in the next few days to something like a "gradual development by feedback". —Preceding unsigned comment added by Wolfsson (talk • contribs) 17:51, 8 April 2010 (UTC)[reply]

Are you kidding? Evolution is an English word. And English, being a context-sensitive language, allows words to take on different meanings in different contexts. Like evolution. The word "evolution" means "change over time;" that's all. In the biological context, it refers to the change in genetic frequency in populations suffering environmental attrition. In this context, it is a perfectly acceptable word. Korval (talk) 01:50, 9 April 2010 (UTC)[reply]
According to Dictionary.com "evolutionary" means basically two things: (1) developmental -- if this is what we mean then the present sentence is equivalent to "programming languages use a developmental process to develop", an obvious redundancy. (2) of, pertaining to, or in accordance with a theory of evolution, esp. in biology---this meaning being inadequate according to my previous explanation. So, either of the two meanings makes the sentence inadequate---of course what you say about context-sensitivity is true, but it means that the meaning is selected from a pool of available meanings according to context. However, if neither of the meanings fits, the sentence needs to be reformulated. --Wolfsson (talk) 06:36, 9 April 2010 (UTC)[reply]
No, actually, according to Dictionary.com, "evolutionary" also means "pertaining to or performing evolutions." They provide 10 definitions of evolution. The one used here is #4, "a process of gradual, peaceful, progressive change or development, as in social or economic structure or institutions." So the word is perfectly valid, as this clearly explains how the C++0x specification is being defined (especially the "gradual" part; WG21's got that down pat).
What amuses me is the fact that we're even having this conversation. Because if the word offended you so much, you could have changed it and almost assuredly nobody would have noticed or objected. Yet you felt the need to write an entire 3 paragraph essay on why it was inappropriate. So why the discussion? Korval (talk) 03:51, 10 April 2010 (UTC)[reply]
The C++ standards committee is divided into three subgroups. The Core [language] Working Group, the Library Working Group, and the Evolution Working Group. The latter is headed by Bjarne Stroustrup himself, and is responsible for dealing with proposals that seek to add new features to the language - as in "evolving" the language, the way I see it. decltype (talk) 06:57, 10 April 2010 (UTC)[reply]
Words are important: they can even make you believe lies. I agree that some of the older and especially the greco-roman meaning ("unrolling"/"unfolding") of the word "evolution" would be appropriate here, but these are not dominant. Because of the biological meaning the word leads to false inferences of the form: "Well, programming languages do evolve, don't they: then probably there is evolution in biology as well!"--Wolfsson (talk) 14:57, 10 April 2010 (UTC)[reply]
Oh, now this discussion makes sense. You're one of those anti-evolution people. And you think that the more the word "evolution" gets used outside of biology, the more people will accept biological evolution as well. So you try to confine the use of the word to as few places as possible, on some delusional belief that this will somehow challenge the evidence for biological evolution.
See, if you had just taken the word out without making a big deal over it, I'd likely have just let it pass. However, anti-science is one of my personal pet-peeves. And coupled with Decltype's point about the Evolution Working Group, I'm afraid I'm going to have to roll back your change. Though it did clue me into some odd grammar in the surrounding sentence. Korval (talk) 21:51, 12 April 2010 (UTC)[reply]

Just a few concluding remarks because this would lead far from here—but we can continue on my talk page if you like. As you have very sharply pointed out, I'm indeed rather anti-scientistic and anti-evolutionist, to which you may add that I have been a quite successful scientist for quite some time—so I know much more about science than the 99.9...9% of people, who merely believe what they are told. I'm sure there are many for example who sincerely believe that there is analogy between (the conjectured) biological evolution and the "evolution" of C++ —maybe even those who chose the name Evolution Working Group. That's why I deemed imortant in the first place to point out that this is not the case.

Two short reactions on what you said: (1) There is of course no as indeed cannot be any evidence for evolution—in the sense of a species transforming into another. (Not counting viruses which do not really form species.) (2) I am not "one of those" whom you probably mean because the real alternatives to evolution are not creationism or something like Intelligent Design. These are the ones that get some publicity since they are relatively easy to discredit.--Wolfsson (talk) 18:00, 13 April 2010 (UTC)[reply]

If I continue to assume that you are not going off-topic here, then it seems that I have to accept the logic that your discredit the use of a word because you disbelieve what it indicates. But anyways, Merriam-Webster defines the word FIRST as a synonym of derive (before even mentioning its biological meaning). That has nothing to do with natural evolution. Merriam-Webster also explains the word as develop. Both derive and develop fit well into the context. Kxx (talk | contribs) 20:31, 13 April 2010 (UTC)[reply]

Neutrality of article

The article seems bereft of criticism of the new features. I can assure you that there are alternative points of view on the standard to, this will solve all of C++'s problems.</strawman> ᛭ LokiClock (talk) 10:07, 16 May 2010 (UTC)[reply]

Quoth, In Standard C++ there are restrictions on what types of objects can be members of a union. For example, unions cannot contain any objects that define a non-trivial constructor. Many of the limitations imposed on unions seem unnecessary, so in the next standard all restrictions on the types of members of unions will be removed, with the exception of reference types. These changes will make unions easier to use, more powerful, and much more useful.

I think it is merely a matter of no~one having written those criticisms. The above quote could be tightened somewhat, why don't you go ahead and either propose a change or just do it? And then remove that "disputed" plate, please. Esben (talk) 10:52, 16 May 2010 (UTC)[reply]
While I do agree that the passage you quoted does seem slightly biased, non-fact based, and ambiguous (and have since replaced it with more concrete language), I don't see how this applies to the article as a whole. The article itself does not claim that anything will "solve all of C++'s problems;" most of the sections are nothing more than a more readable version of the current C++0x proposal documents. Each feature solves only what it claims to solve, and they certainly and irrefutably do that. Variadic templates will allow templates to take arbitrary numbers of arguments; the article makes no claim that it make the programmer's life better or anything of that nature.
If you believe that these facts are in dispute, you will need to do as Esben suggests and provide references that show that these facts are in dispute. Korval (talk) 03:38, 17 May 2010 (UTC)[reply]
First of all, the burden of proof rests on the claimant, so I need under no circumstances to provide references to discredit a fact. Secondly, the view that they solve X problems is support for the addition, whereas there is not even a general statement to the effect of, "some people feel that the addition of features to the language is unnecessary," much less criticisms, of the necessity or else, of each addition. I got the impression of a strongly biased article from the whole of it, and then scanned the article for a quote to illustrate what I meant. I did not read the Unions section and then say "by golly, this article is biased!" Please don't ask me to remove a neutrality template before the issue has even been fully discussed. ᛭ LokiClock (talk) 11:52, 17 May 2010 (UTC)[reply]
I just googled "criticisms of C++0x." This first result should provide some ideas on what can be addressed in the article. ᛭ LokiClock (talk) 11:54, 17 May 2010 (UTC)[reply]
Are you seriously claiming that undergraduate's lolcat-ridden blog post is a high-quality reliable source? —Korath (Talk) 13:17, 17 May 2010 (UTC)[reply]
No, I'm saying obviously no one's looked for criticism of the standard or they would have easily found it. ᛭ LokiClock (talk) 17:09, 17 May 2010 (UTC)[reply]
Thanks for pointing out that section; if you can identify other passages with similar NPOV issues and either correct them or flag them, that would be greatly appreciated. Authoring a well-sourced criticisms section would also be welcomed. But flagging the whole article for NPOV isn't specific enough to let anyone productively address your concerns. --Sacolcor (talk) 16:44, 17 May 2010 (UTC)[reply]
I'll post them as I find them. My main concern is the lack of said criticism section, because thats what I came to the article looking for. ᛭ LokiClock (talk) 17:09, 17 May 2010 (UTC)[reply]
  • A: However, the list of rules in C++03 is overly strict.
  • B: As in Mr. Firstresult, the means of achieving a type safe NULL pointer constant and the effects doing so has on the language can be questioned. Such a questioning view is not represented. ᛭ LokiClock (talk) 18:06, 17 May 2010 (UTC)[reply]
I don't have time at the moment for a full scan of the article, and again the main problem is what isn't there, not was is, so I'm gonna tie up my part of this with a birdfeeder if that's alright with you all. ᛭ LokiClock (talk) 03:00, 18 May 2010 (UTC)[reply]