June 2017

P0408R2: Efficient Access to basic_stringbuf’s Buffer -- Peter Sommerlad

A new WG21 paper is available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: P0408R2

Date: 2017-06-07

Efficient Access to basic_stringbuf’s Buffer

by Peter Sommerlad

Excerpt:

This paper proposes to adjust the API of basic_stringbuf and the corresponding stream class templates to allow accessing the underlying string more efficiently.

N4666: National Body Comments: ISO/IEC PDTS 22277, C++ Extensions for Coroutines -- Barry Hedquist

A new WG21 paper is available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4666

Date: 2017-06-05

National Body Comments: ISO/IEC PDTS 22277, C++ Extensions for Coroutines

by Barry Hedquist

Excerpt:

Attached is SC22 N5205, a complete set of National Body Comments submitted to JTC1 SC22 in response to the SC22 N5193, Ballot for ISO/IEC PDTS 22277, C++ Extensions for Coroutines.

These comments are to be addressed at the next WG21 meeting in Toronto, July 10 - 15, 2017.

Document numbers referenced in the ballot comments are WG21 documents unless otherwise stated.

CppCon 2016: High Performance Code 201: Hybrid Data Structures--Chandler Carruth

Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:

High Performance Code 201: Hybrid Data Structures

by Chandler Carruth

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Modern programs’ performance characteristics are often dictated by their data. Whether the cache locality of data access, the size of working set, or avoiding costly memory allocation overhead. Unfortunately, the standard C++ library data structures range from adequate to terrible at controlling these aspects, and they don’t provide any of the core mechanisms needed for extremely efficient data structure design.

This talk will present the core concepts of designing high performance data structures in C++. It is based on years of experience in the LLVM compiler as well as several other large code bases. From these principles, the talk will propose a suite of data structures that provide performance without loss of generality or functionality. As much as this talk will present specific data structure designs, its primary intent will be to give an understanding of what makes these structures have greater performance than more naive approaches.

Quick Q: When is an rvalue evaluated?

Quick A: When it is assigned.

Recently on SO:

When is an rvalue evaluated?

s2 binds to the expression s1 + s1, but is this evaluated at the time s2 is assigned

Yes.

And also would s2 hold memory for a temporary string?

Precisely, s2 is bound to a temporary std::string.

s1 + s1 will produce a temporary std::string, which will be bound to the reference s2 (and its lifetime is extended to the lifetime of the reference). Then s2 += "Test";, performs operator+=() on  s2, i.e. the temporary std::string.

CppCon 2016: Garbage In, Garbage Out: Arguing about Undefined Behavior...--Chandler Carruth

Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:

Garbage In, Garbage Out: Arguing about Undefined Behavior...

by Chandler Carruth

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

There has been an overwhelming amount of tension in the programming world over the last year due to something that has become an expletive, a cursed and despised term, both obscene and profane: **undefined behavior**. All too often, this issue and the discussions surrounding it descend into unproductive territory without actually resolving anything.

In this talk, I'm going to try something very bold. I will try to utterly and completely do away with the use of the term "undefined behavior" in these discussions. And I will unquestionably fail. But in the process of failing, I will outline a framework for understanding the actual root issues that the software industry faces here, and try to give constructive and clear paths forward, both for programmers and the programming language.

And, with luck, I will avoid being joined on stage by any unruly nasal demons.

CppCast Episode 103: Travis CI with Richel Bilderbeek

Episode 103 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Richel Bilderbeek to talk about the benefits of using Travis CI for C++ developers and the role of C++ in theoretical biology.

CppCast Episode 103: Travis CI with Richel Bilderbeek

by Rob Irving and Jason Turner

About the interviewee:

Richel Bilderbeek is a C++ developer for 17 years. He is mostly interested in what the literature has to say about good C++ practices, then teaching children and to adults, additionally writing articles, blog posts and tutorials. In his professional life, he is a PhD in theoretical biology.

C++17 in details: fixes and deprecation

C++17 brings some language fixes and deprecation. See what have changed.

C++17 in details: fixes and deprecation

by Bartlomiej Filipek

From the article:

The draft for the language contains now over 1586 pages! Due to compatibility requirements, the new features are added, but not much is removed. Fortunately, there are some things that could go away.