N4548: WG21 2015-07-20 Telecon Minutes -- Roger Orr

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: N4548

Date: 2015-07-20

WG21 2015-07-20 Telecon Minutes

by Roger Orr

Excerpt:

"Move to direct the Convener to transmit the approved updated Concepts TS working paper (attachment ts.pdf r2) for publication." [...] There were no objections, so the poll was carried.

CppCon 2014 Hourglass Interfaces for C++ APIs--Stefanus DuToit

Have you registered for CppCon 2015 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 2014 for you to enjoy. Here is today’s feature:

Hourglass Interfaces for C++ APIs

by Stefanus DuToit

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

C++ provides a much richer set of abstractions than C. Classes, templates, overloading, and other core C++ features can be leveraged for more readable syntax, better compile time typechecking, more open ended genericity and improved modularity. On the flip side, C89 still boasts some advantages over C++, especially when viewed through a pragmatic lens. C ABIs on many platforms have been stable for decades, practically every language supports binding to C code through foreign function interfaces, and including nearly any C89 header has a negligible effect on compile time on modern computers.

The Hourglass pattern provides the best of both worlds. It's a way to structure libraries that retains the pragmatic benefits of C89 while still providing C++'s richness both at an interface and implementation level. It makes providing bindings from other languages to C++ libraries easier, and insulates from ABI issues such as incompatibilities between debug and release variants of runtimes. This talk provides an overview of the pattern, teaches practical techniques for its implementation using C++98 and C++11, and shares experience from using the pattern in real world projects.

RVO V.S. std::move -- Zhao Wu

Discussion about the RVO optimization technique & std::move.

RVO V.S. std::move

by Zhao Wu

From the article:

To summarize, RVO is a compiler optimization technique, while std::move is just an rvalue cast, which also instructs the compiler that it's eligible to move the object. The price of moving is lower than copying but higher than RVO, so never apply std::move to local objects if they would otherwise be eligible for the RVO.

CppCon 2014 C++ Test-driven Development--Peter Sommerlad

Have you registered for CppCon 2015 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 2014 for you to enjoy. Here is today’s feature:

C++ Test-driven Development

by Peter Sommerlad

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Unit Testing and TDD, if applied correctly, lead to high quality and simple code. If done by hand, both often require writing some boiler-plate code and can be slow and cumbersome. Especially refactoring without good tool support can be a burden. Java and C# developers are used to have good tool support for these tasks to be effective. Many C++ developers often aren't even aware of the need for the practices, because without tool support and training of the goals, they are hard to discover.

This talk introduces C++ Unit Testing, Test-driven Development, and Refactoring and demonstrates the tooling available for Eclipse CDT for free on www.cevelop.com that was inspired and implemented by the author and his team.

For example, when phrasing a unit test to use a to-be-defined class, the class is generated automatically from its name used as a type. Another tool feature is simplifying a function, by extracting a sub-function and placing a call in its place.

Efficient optional values -- Andrzej Krzemieński

Andrzej goes into some details of optional values in his recent blog post.

Efficient optional values

by Andrzej Krzemieński

From the article:

What do you use Boost.Optional for? In my experience, the answer was typically one of the following:

  1. Because my type T has no null state (like -1) that would indicate that I have no proper value.
  2. Because, I need to perform a two-phase initialization (I cannot initialize my T yet, but I already need it alive).
  3. Because I need an interface that would indicate to the type system that my value may not be there and that its potential absence should be checked by the users.

In this post we will focus exclusively on the third motivation.

Bitesize Modern C++: using aliases--Glennan Carnie

Do you know how to use type aliasing?

Bitesize Modern C++: using aliases

by Glennan Carnie

From the article:

In a C++ program it is common to create type aliases using typedef. A type alias is not a new type, simply a new name for an existing declaration. Used carefully, typedef can improve the readability and maintainability of code – particularly when dealing with complex declarations...

Programmatic access to the call stack in C++--Eli Bendersky

The call stack can be accessed without debugger too:

Programmatic access to the call stack in C++

by Eli Bendersky

From the article:

Sometimes when working on a large project, I find it useful to figure out all the places from which some function or method is called. Moreover, more often than not I don't just want the immediate caller, but the whole call stack. This is most useful in two scenarios - when debugging and when trying to figure out how some code works...

CppCon 2014 Making Allocators Work, Part II—Alisdair Meredith

Have you registered for CppCon 2015 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 2014 for you to enjoy. Here is today’s feature:

Making Allocators Work, Part II

by Alisdair Meredith

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Memory is an important property for every object, as whatever resources it manages, it must occupy some memory. THe ability to customize memory allocation is important for every C++ program that cares about performance, debug ability and support.

The original C++ standard supported an allocator parameter for every container, yet this feature was widely derided or ignored, as it was underspecified to the point it could not portably be used. C++11 makes significant changes to the allocator model, that simply its use while making it more powerful.

The Library Fundamentals TS goes further, allowing allocators’ type to be supplied at runtime, rather than compile type, using classic object oriented polymorphism - yet building on the infrastructure laid down in C++11.

This material should be of interest to both library authors and consumers, although clearly there are more details for the implementers to absorb. It also includes an interesting case study in C++11 compile time reflection, as required to implement the new ‘allocator_traits’ facility.

PeriodicFunction--Tony “Bulldozer00” (BD00) DaSilva

An interesting article showing how to call a function periodically:

PeriodicFunction

by Tony “Bulldozer00” (BD00) DaSilva

From the article:

In the embedded systems application domain, there is often the need to execute one or more background functions at a periodic rate. Before C++11 rolled onto the scene, a programmer had to use a third party library like ACE/Boost/Poco/Qt to incorporate that functionality into the product. However, with the inclusion of std::thread, std::bind, and std::chrono in C++11, there is no longer the need to include those well-crafted libraries into the code base to achieve that specific functionality...

CppCon 2014 Making Allocators Work, Part I--Alisdair Meredith

Have you registered for CppCon 2015 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 2014 for you to enjoy. Here is today’s feature:

Making Allocators Work, Part I

by Alisdair Meredith

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Memory is an important property for every object, as whatever resources it manages, it must occupy some memory. THe ability to customize memory allocation is important for every C++ program that cares about performance, debug ability and support.

The original C++ standard supported an allocator parameter for every container, yet this feature was widely derided or ignored, as it was underspecified to the point it could not portably be used. C++11 makes significant changes to the allocator model, that simply its use while making it more powerful.

The Library Fundamentals TS goes further, allowing allocators' type to be supplied at runtime, rather than compile type, using classic object oriented polymorphism - yet building on the infrastructure laid down in C++11.

This material should be of interest to both library authors and consumers, although clearly there are more details for the implementers to absorb. It also includes an interesting case study in C++11 compile time reflection, as required to implement the new 'allocator_traits' facility.