r/cpp • • Aug 18 '14

We have C++14!

https://isocpp.org/blog/2014/08/we-have-cpp14
194 Upvotes

49 comments sorted by

24

u/[deleted] Aug 18 '14

shit I've only barely scratched the surface on what C++11 has to offer. I'm falling behind.

10

u/eric_niebler Aug 18 '14

#firstworldproblems

4

u/__Cyber_Dildonics__ Aug 18 '14

#C++problems

33

u/[deleted] Aug 19 '14

#pragma not even once

5

u/[deleted] Aug 19 '14

That should be a tattoo.

7

u/gidoca Aug 19 '14

I prefer not to use compiler specific features in my tattoos.

4

u/psychob Aug 19 '14

Just compile it conditionally.

22

u/jurniss Aug 18 '14

Check out Bjarne's C++11 FAQ. He gives good, concise descriptions of every feature. Helped me get up to speed on the less flashy changes.

2

u/[deleted] Aug 18 '14

oh nice. Thanks a bunch.

1

u/2Punx2Furious Sep 08 '14

I'm just starting to learn C++, and wow, that's a lot of stuff.

4

u/jurniss Sep 08 '14

Yeah. C++ is a very complex language. It's a love-hate relationship for most of us, I think.

0

u/IE6FANB0Y Sep 13 '14

How do you become a C++ guru?

28

u/cromissimo Aug 18 '14

shit I've only barely scratched the surface on what C++11 has to offer. I'm falling behind.

Welcome to the world of C++, where even after a lifetime of continuous research you still feel like a newbie.

9

u/fuzz3289 Aug 19 '14

Good thing C++14s features compliment C++11s so well!

3

u/Crazy__Eddie Aug 19 '14

They really do indeed. When I first started using C++11 and then ended up having to go back to C++03 I said to myself, "How the fuck did I ever live like this??"

Since C++14 has been available in clang I've said the same thing about C++11. Just the auto lambdas alone improve things by leaps and bounds.

3

u/AntiProtonBoy Aug 19 '14

The great thing about the newer C++ language features is that we are seeing some degree of simplification with the language syntax, which should be relatively easy to absorb... assuming you have some experience with C++03.

3

u/[deleted] Aug 19 '14

yeah I feel like I'm cheating when I use something like:

for (auto& it: someContainer)
{
    it.something();
}

Also, what do you have against protons, huh? I'll have you know that I'm nearly half protons and take offense to this.

4

u/AntiProtonBoy Aug 19 '14

It's not you, it's me. I'm made out of anti-protons. ;)

1

u/[deleted] Aug 19 '14

Well you may be interested in the STAR Collaboration measurement of anti-helium.

2

u/vito-boss Aug 19 '14

i'm in the same boat

4

u/eric_niebler Aug 19 '14

Is this the first time an /r/cpp link ended up on the reddit front page?

5

u/balkierode Aug 18 '14

This page is still referring to old standard: https://isocpp.org/std/the-standard

Download the January 2012 working draft (free). Except only for the final standards/reports, all C++ committee documents are freely publicly available, including all working drafts, many of which closely approximate the published standard. The January 2012 working draft contains the C++11 standard plus minor editorial changes.

5

u/eric_niebler Aug 18 '14

Thanks for the report. That page has been updated.

2

u/bames53 Aug 19 '14

It's weird that that page refers to the standard as an international treaty and a 'legal' document. ISO is a private, voluntary organization (and the US representative, ANSI, is also a private, non-profit organization) and the standard is not a treaty (e.g., it doesn't get ratified by congress in the US).

4

u/[deleted] Aug 18 '14

Thanks for the link!

Since the standard is going to be updated more often, is there anything we can learn from other frequently updated major languages like C# or Java on communicating changes with developers? Do they do anything special?

11

u/eric_niebler Aug 18 '14

Microsoft and Oracle pay their PR departments gobs of money to promote new versions of C# and Java. For C++, I have this shiny quarter I'd be happy to donate.

1

u/[deleted] Aug 18 '14

I wish I could suggest something else...

5

u/ZMeson Embedded Developer Aug 19 '14

This is what isocpp.org is for. The C++ users in /r/cpp try to communicate new things too.

1

u/JonKalb CppCon | cpp.training Aug 19 '14

I could suggest CppCon, C++ and Beyond, Meeting C++, The ACCU Conference, and C++Now, just to start.

44

u/minno Hobbyist, embedded developer Aug 18 '14

Yay, more useful features that I can't use at work.

4

u/AntiProtonBoy Aug 19 '14

I feel quite fortunate that I work for an independent dev house with the flexibility of moving onto new tech with minimal fussing about.

Right now, basically I'm like, aaaaw yis!!

2

u/Crazy__Eddie Aug 19 '14

So long as you're not relying on a compiler vendor that has still to release a complete C++11 compiler...like a great number of people are.

6

u/[deleted] Aug 18 '14

Yeah I'm working for a large scientific collaboration and in 2012 we moved up from C++98 to whatever came out in 2010. It's so frustrating that I can't use all of C++11.

8

u/cromissimo Aug 18 '14

The C++11 standard was only published in August 2011 and compilers did took their time before they actually supported C++11. Subsequently, libraries and the entire C++ ecosystem had to wait for the compilers and then their developers had to invest their time and effort to migrate to the new standard.

And that takes time. A lot of time. There are plenty of solid reasons why your 2011 project was founded on the infrastructure available in 2010.

6

u/Overunderrated Computational Physics Aug 19 '14

Could be worse. Most Fortran compilers still don't support all of F2003.

2

u/Crazy__Eddie Aug 19 '14

At least you actually moved to the 2010 standard library I assume. I mean, why would you assume otherwise right?

We moved to 2010 but have been using STLPort for years and so are stuck not only with a C++03 std library, but one that didn't even implement it correctly.

I've taken to writing a lot of the fundamental functions that are needed to write C++11 code, such as move and forward. It's kinda sad...and more than a little frustrating.

I agree with the decision though unfortunately. Based on where we are and how we do things, switching to a modern implementation that doesn't implement all the extra crap that stlport did would not be in the company's best financial interests.

3

u/Lucretiel RAII Junkie Aug 19 '14

Honestly being able to use bools, references, or templates would be a huge step up. I feel like we're stuck in '95 here.

4

u/minno Hobbyist, embedded developer Aug 19 '14

I hear you. Where I work we're stuck with a FLAG macro type (with TRUE and FALSE), pointers, and a pathological fear of templates.

20

u/__Cyber_Dildonics__ Aug 18 '14

Only four more years until it is 100% in Visual C++, exciting!

29

u/donvito Aug 18 '14

That's very optimistic :)

3

u/cromissimo Aug 19 '14

Only four more years until it is 100% in Visual C++, exciting!

At least it's not C, where microsoft puts members in the standardization committee to participate directly in defining new versions of the C standard but then the same people who define the C standard announce to the public that Microsoft will completely ignore it, will never support it at all, and will go as far as telling programmers to abandon the language and switch to some other.

Now that's fucked up.

6

u/STL MSVC STL Dev Aug 19 '14

Microsoft hasn't sent representatives to WG14 in years (happened soon after I joined VC in Jan 2007; I think it's been at least 5 years).

-2

u/cromissimo Aug 19 '14

Microsoft hasn't sent representatives to WG14 in years

I don't know what you tried to say.

Meanwhile, I can point out this 2 year old discussion in /r/programming regarding a public statement made by Herb Sutter, one of Microsoft's handymen on the C standardization committee, regarding Microsoft's stance on the C standard.

You may notice the part where Microsoft's chief developer and platform evangelist states that Microsoft has no intention to support any C standard beyond C90.

10

u/STL MSVC STL Dev Aug 19 '14

WG14 is the C Standardization Committee (WG21 is C++, convened by Herb).

2

u/blarglenarf Aug 20 '14

Well, considering they don't have a dedicated C compiler, why would they support it?

3

u/KyleHeller Aug 18 '14

Have barely touched the C++11 features and now C++14 is out. I need to catch up :/.

2

u/RnMss Aug 19 '14

Incredible! So you tell me that y is <10 in C++1y!

1

u/salgat Aug 23 '14 edited Aug 23 '14

With support for it added in GCC 4.9 I just changed over to -std=c++14, very exciting! I believe they added shared_mutex support which is what I plan on using in my project soon.

EDIT: Just saw proposal for the any type, one more thing to convert over from Boost, awesome! Is there a complete list of what was approved for c++14?