Posting Freak
Posts: 854
Threads: 71
Joined: 2008-07
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
Job: Software Dev.
2011-08-17, 11:09 PM
(This post was last modified: 2011-08-18, 07:43 AM by Spaz.)
Wikipedia has a feature list.
MSVC already supports a good portion of it, as does gcc.
Things I'm excited about: - Move constructors. If you want to return a vector, you can do so without making a copy of it or relying on the compiler to use the return-value optimization.
- Auto. Like C#'s var. Nice for long, template-y types returned from a function.
- A foreach loop. About time.
- Constructor delegation. No more making an extra function just for shared constructor code.
- Explicitly tell the compiler a function is intended to be an override of a base class virtual function so you don't get screwed by a typo.
- The ">>" in vector<vector<int>> will get parsed correctly instead of forcing you to do the uglier vector<vector<int> >.
- R"Raw\Strings\With\Backslashes\In\Them".
- Smart pointers, hashmaps, threading in the standard library.
- Lambdas and closures.
No modules though, so you still have to write some duplicate code with separate header and implementation files. There are utf-8, utf-16, and utf-32 string literals but still no real unicode support - the standard library still only deals with plain ascii strings. And iostreams is still terrible.
Senior Member
Posts: 565
Threads: 40
Joined: 2009-01
Gender: Female
Country Flag: Wisconsin
IGN: KatCoroiion
Server: Bera
Level: 183
Job: Bishop
Guild: Risk
Guild Alliance: Bastion
Farm: Bumblefsck
Quote:Type long long int
C++ has always made my head hurt but good lord. longs in C# at least were already 64bit [and are in the other languages i've worked with iirc, haven't had to pay attention to it until recently], so if they made long long int be 64 then what the hell is a normal int, 16?
I like the threading stuff and what they did to sizeof though. If I ever need to pick this up to complete my knowledge of the C family I'll feel a little better about learning it.
I still prefer java though ;-;
Posting Freak
Posts: 3,213
Threads: 466
Joined: 2008-07
Spaz Wrote:- Smart pointers, hashmaps, threading in the standard library.
- Lambdas and closures.
This is most likely the biggest difference which will compress sizes of programs. Or, well, at least the latter.
Posting Freak
Posts: 854
Threads: 71
Joined: 2008-07
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
Job: Software Dev.
Katforks Wrote:C++ has always made my head hurt but good lord. longs in C# at least were already 64bit [and are in the other languages i've worked with iirc, haven't had to pay attention to it until recently], so if they made long long int be 64 then what the hell is a normal int, 16?
I like the threading stuff and what they did to sizeof though. If I ever need to pick this up to complete my knowledge of the C family I'll feel a little better about learning it.
I still prefer java though ;-;
C and C++ are designed to be ultraportable, usable for any conceivable processor architecture. Most (all?) processors these days have 8-bit bytes (where a "byte" means the smallest addressable memory unit), but back in the days when C was created, this was not the case. There were processors with 7-bit bytes. The standard only specifies a minimum size for the integral types. The actual size is compiler/platform dependent. If you want a variable to be a specific size, you can #include <boost/cstdint.hpp> or <stdint.h> or <cstdint> and use int64_t or whatever.
Long long was already supported as an extension by most compilers. If memory serves, MSVC targeting x86 has short=16, int=32, long=32, long long=64.
Posting Freak
Posts: 1,167
Threads: 94
Joined: 2008-07
Gender: Female
Sexual Orientation: Straight
Country Flag: newzealand
long long int... I am getting so sick of typing that in my algorithms assignment (written in C)
Posting Freak
Posts: 854
Threads: 71
Joined: 2008-07
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
Job: Software Dev.
Heidi Wrote:long long int... I am getting so sick of typing that in my algorithms assignment (written in C) 1. You don't have to type "long long int", just "long long" is equivalent.
2. #include <stdint.h>, use int64_t. If that's not available on your system (Visual Studio before 2010), you could typedef it yourself.
Senior Member
Posts: 565
Threads: 40
Joined: 2009-01
Gender: Female
Country Flag: Wisconsin
IGN: KatCoroiion
Server: Bera
Level: 183
Job: Bishop
Guild: Risk
Guild Alliance: Bastion
Farm: Bumblefsck
Spaz Wrote:[stuff] Yeah, this is all kind of new to me. I've grown to hate how inconsistent variable sizes are cross-platform. Haven't done much fiddling down at the byte level recently, not since my OS class and even then we didn't do much of it in C, it was all in assembly.
...as all this stuff grows in size we're not gonna wind up with long long long int and such after a while are we? There has to be better naming conventions ;---;
Posting Freak
Posts: 1,167
Threads: 94
Joined: 2008-07
Gender: Female
Sexual Orientation: Straight
Country Flag: newzealand
Spaz Wrote:1. You don't have to type "long long int", just "long long" is equivalent.
2. #include <stdint.h>, use int64_t. If that's not available on your system (Visual Studio before 2010), you could typedef it yourself.
I'm not using visual studio at all for this. Writing it in Notepad++ and then compiling with gcc
And uhhhh I'll try long long next time I'm working on it, although I've never heard of that before...
Posting Freak
Posts: 854
Threads: 71
Joined: 2008-07
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
Job: Software Dev.
You can do "long long" instead of "long long int", just like you can do "short" instead of "short int" and "long" instead of "long int". :f6:
Posting Freak
Posts: 1,167
Threads: 94
Joined: 2008-07
Gender: Female
Sexual Orientation: Straight
Country Flag: newzealand
Spaz Wrote:You can do "long long" instead of "long long int", just like you can do "short" instead of "short int" and "long" instead of "long int". :f6:
I didn't even know you could do "short int" and "long int". I always thought they were only "long" and "short".
Up until this assignment I'm working on, I only ever needed to use "int".
Posting Freak
Posts: 1,167
Threads: 94
Joined: 2008-07
Gender: Female
Sexual Orientation: Straight
Country Flag: newzealand
Spaz Wrote:You can do "long long" instead of "long long int", just like you can do "short" instead of "short int" and "long" instead of "long int". :f6:
I didn't even know you could do "short int" and "long int". I always thought they were only "long" and "short".
|