Talk:C++11: Difference between revisions
Thecoshman (talk | contribs) →C++11 is here now: following up |
|||
Line 82: | Line 82: | ||
: This does type deduction, but ''only'' because of the `decltype`, not the `auto`. [[User:Korval|Korval]] ([[User talk:Korval|talk]]) 23:31, 3 May 2012 (UTC) |
: This does type deduction, but ''only'' because of the `decltype`, not the `auto`. [[User:Korval|Korval]] ([[User talk:Korval|talk]]) 23:31, 3 May 2012 (UTC) |
||
== <nowiki>{{visible anchor}}</nowiki> at chapter ''Rvalue references and move constructors'' == |
|||
I have changed the two following redirections: |
|||
* http://en.wikipedia.org/w/index.php?title=Move_constructor&redirect=no |
|||
* http://en.wikipedia.org/w/index.php?title=Rvalue_references&redirect=no |
|||
Before my change, theses pages was redirecting to <nowiki>{{visible anchor}}</nowiki> within the middle of the section text. |
|||
Therefore, I was lost on the Article page, and I thought my browser had a bug. |
|||
(I did not notice the <nowiki>{{visible anchor}}</nowiki> in the Wikipedia code.) |
|||
Actually, I do not think putting <nowiki>{{visible anchor}}</nowiki> in the middle of a section is a good idea. |
|||
Because the reader expects to see the Article title or the section title, not to be redirected in the middle of a sentence. |
|||
Who agree/disagree? |
|||
[[User:Oliver H|Oliver H]] ([[User talk:Oliver H|talk]]) 15:41, 28 September 2012 (UTC) |
Revision as of 15:41, 28 September 2012
This article has not yet been rated on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||
Please add the quality rating to the {{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
|
|
|||||
This page has archives. Sections older than 60 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
Random number generators
Where did the table of properties of random number generators come from? It looks a bit dubious; one would not expect the high-quality mersenne_twister algorithm to be "fast" if the simplistic linear_congruential algorithm is only "medium" speed. —Preceding unsigned comment added by 68.33.168.195 (talk) 00:53, 11 September 2010 (UTC)
I don't know any implementation of a Mersenne Twister that is (or has the potential to be) faster than a simple linear congruential generator. I guess the "speed" column in the table needs an update. —Preceding unsigned comment added by 134.93.143.104 (talk) 15:08, 4 January 2011 (UTC)
- Don't make guesses. If you have sources supporting whichever is faster, put them in.Kxx (talk | contribs) 16:18, 4 January 2011 (UTC)
There's nothing about speed in the ISO standard (as one would expect), and the state size column directly contradicts the standard. I've updated the table (replaced it with a list), and also extendedthe incomplete list of distributions that was below, to reflect what is verifiable. Chrisjohnson (talk) 12:18, 12 June 2012 (UTC)
C++11 is here now
Reading through this article, there is a lot of talk of features C++11 'will' have. Should this not be updated to say that C++11 does support these features. I would have changed them, but it seems like it could be a deliberate thing. Thecoshman (talk) 14:38, 14 March 2012 (UTC)
- No, it's just a holdover from when C++11 was still the future. Sometime back, I did a pass to clean up most of them, but apparently I missed a few. Korval (talk) 02:32, 2 April 2012 (UTC)
- I have not given it a full look over, but if I am not mistaken, there are still a few 'C++11 will have' bits in the article. I will do my best to remove update to be what C++ does have when I get a chance, but if any one else can confirm it is all cleared up, can you just follow up to this. Thecoshman (talk) 09:53, 17 September 2012 (UTC)
Compiler Support
Could we perhaps have a section or table which describes which compilers support C++11 and which features are supported in which versions?
For example: gcc 4.2 supports C++11 except Lambda's. RustyBadger (talk) 13:03, 18 April 2012 (UTC)
- GCC 4.2 most certainly does not. 4.2 was released in 2008, which was well before the standard was finalized. 4.2 supports a few C++11 things, but really only those things that it always supported as extensions. There's a good reason not to have this stuff here: it changes far, far too quickly. There are websites that track this stuff much better than Wikipedia can. Korval (talk) 23:20, 3 May 2012 (UTC)
- This is the best source that most people refer to: http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport - Andrewmp (talk) 13:18, 21 May 2012 (UTC)
Alternative function syntax
This section ends with the line "The use of the keyword “auto” in this case means something different from its use in automatic type deduction."
Nothing else I read in the article suggests this is true, could we get some actual explanation? It seems like the other section of this article suggests that using auto as a method to set the return type automatically does exactly that when paired with decltype. Decltype sets the type the expression is going to return, and auto subsequently picks that up.
HacksawPC (talk) 15:37, 2 May 2012 (UTC)
- You're conflating two things, which is why I specifically put that sentence there. All `auto` does is say "the return type will be specified after the function arguments". That's it. You do not have to use `decltype` with late-specified return types. This is perfectly valid:
auto SomeFunc() -> int;
- No type is being deduced by the compiler; it's explicitly specified as `int`. Again, "The use of the keyword “auto” in this case means something different from its use in automatic type deduction." No type is being automatically deduced here. It's simply a placeholder for the compiler. There was even debate in the committee for using `[]` instead, as a way to unify function definitions. This was overturned, primarily for reasons of causing confusion.
- The thing doing the type deduction is the `decltype` keyword, and only `decltype`. For example:
int someGlobal;
decltype(someGlobal) SomeFunc();
- This does actual type deduction, but without `auto`. So no, `auto` in this use is not deducing anything.
- The reason why late-specified return type and `decltype` are used frequently together is because of why you would want to specify the return type after the parameters. If you don't late-specify the return type, then this would not be possible:
template<typename T> decltype(v.func()) SomeFunc(T v);
- You have to late specify the return type because the expression that `decltype` uses depends on the parameter names. And those parameter names don't exist until after the parameter name is parsed. So you late-specify the return type.
template<typename T> auto SomeFunc(T v) -> decltype(v.func());
- This does type deduction, but only because of the `decltype`, not the `auto`. Korval (talk) 23:31, 3 May 2012 (UTC)
{{visible anchor}} at chapter Rvalue references and move constructors
I have changed the two following redirections:
- http://en.wikipedia.org/w/index.php?title=Move_constructor&redirect=no
- http://en.wikipedia.org/w/index.php?title=Rvalue_references&redirect=no
Before my change, theses pages was redirecting to {{visible anchor}} within the middle of the section text. Therefore, I was lost on the Article page, and I thought my browser had a bug. (I did not notice the {{visible anchor}} in the Wikipedia code.) Actually, I do not think putting {{visible anchor}} in the middle of a section is a good idea. Because the reader expects to see the Article title or the section title, not to be redirected in the middle of a sentence. Who agree/disagree? Oliver H (talk) 15:41, 28 September 2012 (UTC)