May 2014

CppCon Program Preview, 1 of N—Boris Kolpackov

The countdown continues: Today we are exactly 100 days out from CppCon 2014.

This morning, the organizers announced that CppCon will have some 100 talks, which going by the size of the program likely makes this the biggest C++ event in... ever. Also, we now have the first set of accepted talks.

CppCon Program Preview, 1 of N

by Boris Kolpackov

From the announcement:

Good news: Due to the large number of submissions (we got over 140), the conference will have 6 tracks instead of the planned 5. This means there will be approximately 100 talks, and that’s not counting keynotes, plenary sessions, and lightning talks (more on those soon). As far as we know no other conference has ever had this number of C++-related presentations which will make CppCon 2014 the biggest event in the history of the language.

Understandably, many of you would like to see the conference program before registering. However, due to a greater than expected number of submissions, the final program is still some weeks away. So to help you make up your mind (or convince your boss) we are going to start publishing the talks as they are accepted. So here is the first chunk (summary first, abstracts following):

Scott Meyers: “Type Deduction and Why You Care”

John JT Thomas: “Embarcadero Case Study: Bringing CLANG/LLVM to Windows”

Rachel Cheng, Michael VanLoon: “Boost: A Bridge from C++98 to C++11; An Introduction to Using More Boost”

Titus Winters: “The Philosophy of Google’s C++ Code”

James McNellis: “Unicode in C++”

 

Scott Meyers: "Type Deduction and Why You Care"

C++98 had template type deduction, and it worked so intuitively, there was little need to understand what took place under the covers. C++11 extends type deduction to include universal references, applies it to auto variables and lambda expressions, then throws in a special auto-only deduction rule. C++14 pushes the boundary further, adding two forms of function return type deduction (auto and decltype(auto)) for arbitrary functions and offering auto parameters for lambdas. The result is that what could be treated as a black box in C++98 has become a topic that practicing C++ developers really need to understand. This talk will give you the information you need to do that.

Speaker’s bio: Scott Meyers is one of the world’s foremost experts on C++ software development. He wrote the best-selling Effective C++ series (Effective C++, More Effective C++, and Effective STL) and is also author of Overview of the New C++ (C++11/14) and Effective C++ in an Embedded Environment.

John JT Thomas: "Embarcadero Case Study: Bringing CLANG/LLVM to Windows"

CLANG/LLVM delivers a highly conforming C++ compiler and architecture for targeting multiple CPUs, and, as such, has seen success in iOS and other operating systems. Embarcadero has successfully delivered the first commercial compiler for Windows based on CLANG/LLVM. This session describes the benefits of CLANG/LLVM as well as the challenges in bringing it to the Windows operating system. Particular emphasis is placed on the managing the changes in CLANG as well as the additional features added to enable Windows development.

Speaker’s bio: John “JT” Thomas, Director of Product Management at Embarcadero Technologies, has more than 15 years of product management and product development experience including hands-on experience with the early versions of Delphi and C++Builder at Borland Software. While at Borland he was a delegate on the ANSI/ISO C++ standards committee. He earned his Computer Science degree from University of California, Santa Cruz and his MBA and MSE from San Jose State University.

Rachel Cheng and Michael VanLoon: "Boost: A Bridge from C++98 to C++11; An Introduction to Using More Boost"

Part one is for those who are stuck with a C++98/03 compiler, but are interested in using more advanced C++11-like strategies. We will discuss some of the differences between C++98 and C++11 while demonstrating how strategic use of Boost libraries can bridge the gap, allowing more modern programming paradigms in many cases.  Part two is a deeper dive into some interesting Boost libraries for those who may be new to Boost usage. We will explore how C++98 and C++11 can be enhanced and extended by the additional richness of Boost libraries. We will use as example some of the boost libraries used in the F5 Networks code base. If there is time leftover, we will discuss our experience upgrading GCC.

Speakers’ bio: Rachel Cheng is a recent graduate from The Evergreen State College is currently employed at F5 Networks. Michael VanLoon is a Senior Software Engineer at F5 Networks, is a member of the Northwest C++ Users group, and has attended ISO C++ Standards Committee meetings. He has benefited from time at Microsoft, Yahoo!, and VMware, among others, before joining F5. He is fascinated with crafting code and is dismayed at code that falls short of its potential.

Titus Winters: "The Philosophy of Google’s C++ Code"

The Google C++ Style Guide is a fairly popular guide for C++ coding practices, both at Google and externally, but some of its recommendations often seem dated and have created controversy and perceived tension with more modern C++ In this talk we will focus on the core philosophies underlying that guide, ranging from the common (be consistent) to the unusual (leave an explicit trace for the reader), and debunk the idea that Google’s C++ is anything less than modern. We’ll discuss how these core ideas inform contentious rules like “No non-const references” and “Don’t use exceptions,” and how the application of those rules has worked for us in practice, both as developers and reliability engineers (SREs).

Speaker’s bio: Titus Winters has spent the past three years working on Google’s core C++ libraries. He’s particularly interested in issues of large scale software engineering and codebase maintenance: How do we keep a codebase of over 100M lines of code consistent and flexible for the next decade? Along the way he has helped Google teams pioneer techniques to perform automated code transformations on a massive scale, and helps maintain the Google C++ Style Guide.

James McNellis: "Unicode in C++"

In some programming languages, text processing is easy. Unfortunately, C++ is not one of those languages. C++ lacks good, built-in support for Unicode, though the situation is starting to improve. This session will begin with a brief overview of text encodings, and an introduction to Unicode and the various Unicode encodings. We’ll look at the woeful state of Unicode support in C++98 (or, really, lack thereof), then take a look at the improvements that were made in C++11 and other improvements that have recently been proposed for standardization. We’ll finish up with a discussion of several libraries designed to make it easier to work with Unicode in C++, including the widely-used, open-source International Components for Unicode (ICU) library.

Speaker’s bio: James McNellis is a senior engineer on the Microsoft Visual C++ team, where he is responsible for the Visual C++ C Runtime (CRT) and C Standard Library implementation. He was previously a member of the Microsoft Expression Blend team, developing the XAML designer tools for Windows 8 apps. Prior to joining Microsoft in 2010, he spent several years working on real-time 3-D simulation and robotics projects in the defense industry. James is a prolific contributor on the Stack Overflow programming Q&A website and occasionally writes for the Visual C++ Team Blog.
 

Writing min function, part 1: The rise of Concepts—Fernando Pelliccioni

[Ed: Note that this article series is not (yet) about C++ code, but it promises to go there and it has an interesting pedigree in its generic programming design analysis (Alex Stepanov) and reviewers (several ISO C++ participants including Andrzej Krzemienski and Dean Michael Berris.]

Writing min function, part 1: The rise of Concepts

by Fernando Pelliccioni

From the article:

This is the first in a series of articles in which I want to transmit what I learned (or what I think I learned) from the books, papers, lectures of Alexander Stepanov.

These are the lessons that Alex gives us, and I want to show them in this series:

  • Specify our algorithms correctly
  • Programming must be based on a solid mathematical foundation
  • Designing our API’s consistently
  • Not always the library implementations provided by the programming languages we use are correct, even though they are designed by “experts”.
  • The concept of Stability
  • Generic programming, of course!

Ref-qualified member functions—Alexander Kulikov

kukuruku.PNGToday on Kukuruku:

Ref-qualified member functions

by Alexander Kulikov

From the article:

Today I’m going to tell you about a new and a little known (to my mind) C++ feature — reference-qualified member functions. I’ll tell about the rules of such functions overloading and, as an example of use, I’ll show you that with the help of ref-qualified you can try to improve the resource management scheme, which is implemented with the help of another C++ idiom — RAII.

N4051: Allow typename in a template template parameter—Richard Smith

A new WG21 paper is available. A copy is linked below, and will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4051

Date: 2014-05-26

Allow typename in a template template parameter

by Richard Smith

Excerpt:

Since the introduction of alias templates, C++ has had type templates that are not class templates, and in particular now has template template arguments that are not class templates. However, the syntax for template template parameters still requires the class keyword be used:

template<typename T> struct A {};
template<typename T> using B = int;

template<template<typename> class X> struct C;
C<A> ca; // ok
C<B> cb; // ok, not a class template
template<template<typename> typename X> struct D; // error, cannot use typename here

... This difference is artificial and is a common surprise. Removing it would make the language simpler.

 

N4049: 0-overhead-principle violations in exception handling—Gutson, Bustamante, Oliva, Diaz

A new WG21 paper is available. A copy is linked below, and will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4049

Date: 2014-05-27

0-overhead-principle violations in exception handling

by Daniel Gutson, Angel Bustamante, Pablo Oliva, Marcos Diaz

Excerpt:

Sometimes the 0-overhead principle is not honored; one has to pay for things that are not used. An instance where this can be observed is the Exception Handling mechanisms implemented by the diverse toolchains.

In an average computing environment, this has little or no importance; the overhead is minimal and its impact is negligible.

But on embedded systems, where memory is scarce, the overhead imposed by unused language constructs can exceed the capabilities of the available hardware, as we will show is the case for exceptions.

N4046: Executors and Asynchronous Operations—Christopher Kohlhoff

A new WG21 paper is available. A copy is linked below, and will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4046

Date: 2014-05-26

Executors and Asynchronous Operations

by Christopher Kohlhoff

Excerpt:

This proposal builds on the type traits defined in N4045 Library Foundations for Asynchronous Operations. This paper is intended as an alternative proposal to N3785 Executors and schedulers.

The type traits introduced in N4045 Library Foundations for Asynchronous Operations define an extensible asynchronous model that can support:

  • Callbacks, where minimal runtime penalty is desirable.
  • Futures, and not just std::future but also future classes supplied by other libraries.
  • Coroutines or resumable functions, without adding new keywords to the language.

The library introduced in this paper applies this asynchronous model, and its design philosophy, to executors. Rather than a design that is restricted to runtime polymorphism, we can allow users to choose the approach that is appropriate to their use case.

Future work will aim to develop guidance on the development of asynchronous operations that participate in an executor-aware model, such as those that integrate operating system services, for example networking support.

N4045: Library Foundations for Asynchronous Operations, Revision 2—Christopher Kohlhoff

A new WG21 paper is available. A copy is linked below, and will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4045

Date: 2014-05-24

Library Foundations for Asynchronous Operations, Revision 2

by Christopher Kohlhoff

Excerpt:

1.1 Changes in this revision

This document supersedes N3964. In this revision, the handler_type<> trait has been
modified to be SFINAE-friendly, and an extended example has been added to section 9.2 to
illustrate how the traits may be specialised by a user to add a new completion token type.

N4044: A Three-Class IP Address Proposal, Revision 1—Christopher Kohlhoff

A new WG21 paper is available. A copy is linked below, and will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4044

Date: 2014-05-24

A Three-Class IP Address Proposal, Revision 1

by Christopher Kohlhoff

Excerpt:

This proposal describes a three-class design for IP address classes:

  • A vocabulary type, ip::address, for use in IP version independent code.
  • An IPv4-specific type ip::address_v4.
  • An IPv6-specific type ip::address_v6.

 

N4041: Concerns with changing existing types in Technical Specifications—Jonathan Wakely

A new WG21 paper is available. A copy is linked below, and will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4041

Date: 2014-05-23

Concerns with changing existing types in Technical Specifications

by Jonathan Wakely

Excerpts:

In Issaquah there were proposals targeting a TS which enhanced existing types in the Standard Library, in particular N3857 which modifies std::future, N3916 which modifies std::function, std::promise and std::packaged_task, and N3920 which modifies std::shared_ptr. ...

Following straw polls the decision was taken to allow a TS to change existing types in namespace std, so that users who opt in to use the TS (via some implementation defined means) get the enhanced versions without needing to change any code. ...

The decision made following the straw polls means for an implementation to ship a TS they must change existing classes in their implementation, which has the potential to make silent ABI changes to users' programs. ...
These issues can make it complicated for implementers to provide TS support, so that users have to wait longer before they have access to an implementation, which then makes it less likely the committee will get useful and timely feedback on the TS contents.

... 

N4034: Destructive Move—Pablo Halpern

A new WG21 paper is available. A copy is linked below, and will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4034

Date: 2014-05-27

Destructive Move

by Pablo Halpern

Excerpt:

This paper proposes a function template for performing destructive move operations -- a type of move construction where the moved-from object, instead of being left in a “valid, but unspecified” state, is left in a destructed state. I will show that this operation can be made non-throwing in a wider range of situations than a normal move constructor, and can be used to optimize crucial operations, such as reallocations within vectors. An array version of the destructive move template is proposed specifically for moving multiple objects efficiently and with the strong exception guarantee.

The facilities described in this paper are targeted for a future library Technical Specification.