Boost 1.56.0 is released

Some welcome news from Boost.org...

Boost 1.56.0 has been released

These open-source libraries work well with the C++ Standard Library, and are usable across a broad spectrum of applications.
The Boost license encourages both commercial and non-commercial use.

This release contains one new library and numerous enhancements and bug fixes for existing libraries.

This is the first release since November of last year, and the last one since Boost migrated from a monolithic Subversion repository to modularized git repositories on github.com. The end users should see no change though, since the archives have the same layout as previous releases.

Read the full announcement for all the details, and for download links.

CppCon 2014 Open Content -- Boris Kolpackov

cppcon-032.PNGToday CppCon announced information about the evening sessions -- and, if you read closely, about early-daytime sessions.

This next bit is important: All CppCon Mon-Thu 8:30-10:00pm evening sessions and all Tue-Fri 8:00-8:45am sessions are free and open to everyone -- free to attend, and to propose and even lead a session whether or not you're registered for the daytime CppCon program. If you are reading this then you're interested in C++, so if you also live locally in the Seattle area then go fire up your calendar now block off all these evenings (and early mornings!) and come on by before and after work and join in the fun! You will learn a lot and enjoy a lot. And if you're attending CppCon but only there for a one- or two-day registration, that means you're still in town and should still plan to attend all these free events for every evening (and early morning) you're there -- if you don't, you're missing a great opportunity and a great part of your visit to CppCon.

From author and committee panels to lightning talks and hackathons and more, you won't want to miss the CppCon night life. This conference does not end at 5:30. Plan to be there again at 8:30pm every night Mon-Thu, and at 8:00am Tue-Fri. It's free as in air.

Here's the link:

CppCon 2014 Open Content

by Boris Kolpackov

And the announcement:

Each evening the conference activities will break for dinner from 5:45 to 8:30, giving you time to head out and enjoy a meal with fellow attendees. But after eating, don’t head back for a boring night in your hotel room -- come back to the venue for another 90 minutes of learning and networking!

Monday through Thursday from 8:30 pm to 10 pm is the evening program. Looser and less structured than the daytime program, it’s designed to get you engaged and give you opportunities that traditional sessions can’t offer. In our six rooms, one will hold a single “conference planned” session that spans the full 90 minutes, and the other five will hold open content, two 45-minute sessions per room. There will also be open content in all 6 rooms from 8:00am to 8:45 Tuesday through Friday.

The “conference planned” sessions are Meet the Authors Monday, Lightning Talks Tuesday, Grill the Committee Wednesday and Conference Planning Thursday. More details on each of these will be coming shortly.

Open content is just that, open! Attendees and speakers alike can propose sessions on anything that interests them. These might be a single facilitator leading a room through an exercise, activity or demo, a panel of 3-5 people taking questions from the room and answering them, a “hackathon” on a specific project, or an open conversation among the whole room. The projector is available (possibly to take collaborative notes, possibly to display content related to the exercise; typical slide presentations are not the best fit for open content sessions.)

Many of these “Birds of a Feather” talks will be proposed on site as the conference progresses. A speaker who gets a lot of post-talk questions may agree to host a Q&A session in the open content time. An attendee inspired by a session may host a session to explore a topic further or start on a group implementation of something. Some can be proposed in advance and with 64 slots to fill, our job will be easier if many of them are. To propose a session, simply email [email protected] and tell us who you are and what you want a session about. If you have time constraints such as “after a specific session” or “not on the same day as a specific session” let us know in the email. (For example, someone who will be grilled at Grill The Committee Wednesday can’t do an open session Wednesday evening.)

These sessions will be open in another way too -- evening content does not require conference registration. That’s right, everyone who is in the area is welcome to come and join us for all the evening sessions, including to propose or lead a session. This is part of our goal to be an inclusive conference for the entire C++ community.

Attendees will be able to express their interest in these sessions in advance, enabling us to schedule them and to select the most popular if we have more submissions than slots. More details on that will follow soon. For now, please email your submissions as soon as you can so that our planning work can get underway. See you in Bellevue!

C++ User Group Meetings in August

Again, the overview about the upcoming user group meetings for the new month. As it is August, there are not as much meetings due to summer.

C++ User Group Meetings in August 2014

by Jens Weller

From the article:

6.8. C++ UG Austin - Pragmatic Type Erasure
13.8 C++ UG Bay area/San Francisco
14.8 C++ UG Dresden - Compile Time Sort"
14.8 C++ UG NRW/Aachen - Various talks
19.8 C++ UG Berlin - Experience with C++11 in ArangoDB
20.8 C++ UG NRW/Düsseldorf - Wartungtechniken
28.8 C++ UG Amsterdam - Event Driven Design in C++11

CppCon Program Highlights, 10 of N: Migrating Code to Modern C++

The CppCon 2014 conference program has been posted for the upcoming September conference. We've received requests that the program continue to be posted in "bite-sized" posts, a few sessions at a time, to make the 100+ sessions easier to absorb, so here is another set of talks. This series of posts will conclude once the entire conference program has been posted in this way.

 

There is lots -- lots -- of existing C++ code. How can you effectively bring existing C++ code forward to C++11/14? How can you upgrade your coding styles and conventions? The following CppCon 2014 talks tackle these issues and more.

In this post:

  • Adventures in Updating a Legacy Codebase
  • Elevate Your Code to Modern C++11 with Automated Tooling
  • An Overview of C++11/14

 

Adventures in Updating a Legacy Codebase

Still maintaining a legacy application? Do you have strdup()'s crying to be replaced with std::string? Do pre-standard headers such as iostream.h litter your code? Do boost libraries no longer compile with your favorite C++98 compiler? From GUIs to kernel drivers, this talk will look at some of the adventures taken while updating a codebase with more than 20 years of history to C++11.

Speaker: Billy Baker, Senior Staff Engineer, FlightSafety International. Billy Baker has developed deterministic real-time flight simulation software using C++ for FlightSafety International, Evans and Sutherland and Boeing since 1997. At C++ committee meetings, he can most likely be found in LWG. He received his B.S. and M.S in Applied Mathematics from the University of Tulsa and is currently working on a Ph.D. in Computer Science. If asked, he will tell stories from his research semester at NCSA when web browsers did not yet have forms support.

 

Elevate Your Code to Modern C++11 with Automated Tooling

This talk will motivate and demonstrate how to transform your existing C++ code into more modern style and better quality. A key to that is refactoring the code into better shape. While manual refactoring can be tedious and error prone the author demonstrates automated refactoring that was created by his students and assistants and himself over the last nine years on the basis of Eclipse CDT. The tooling works with all compilers, because it is independent of one.

For example, we will show how to eliminate unnecessary macros or replace them by type-safe C++11/14 alternative code automatically. Or, to replace pointers, plain arrays and manual memory management by references, smart pointers, std::string, std::array, or std::vector automatically. Also other transformations, such as introducing a template parameter to reduce a coupling to a single concrete type are demonstrated. All with the goal to modernize and hopefully simplify your C++ code. Even if you are not deeply interested in modernizing your code base, some helpful tooling, such as toggling function definitions into a single place, to change their signature, can be of great help. On the other hand, many of the proposed improvements can also be applied with your favorite code editor only more tediously.

Speaker: Peter Sommerlad, Professor, Director IFS, FHO HSR Rapperswil -- IFS Institute for Software. Prof. Peter Sommerlad is head of IFS Institute for Software at FHO HSR Rapperswil. Peter is co-author of the books POSA Vol.1 and Security Patterns. His goal is to make software simpler by Decremental Development: Refactoring software down to 10% its size with better architecture, testability and quality and functionality. Peter is a member of the C++ standardization committee, ACCU, ACM, SI and president of SWEN.Website: http://wiki.hsr.ch/PeterSommerladTwitter handle: @PeterSommerlad

 

An Overview of C++11/14

This accelerated introduction to C++11/C++14 surveys most of the key additions to the C++ language, including support for 1) increased code clarity (lambdas, uniform initialization, auto, new OOD control), 2) improved performance (rvalue references and move constructors), 3) multithreading (concurrency and atomic types).

The presentation is designed for those who truly need a quick overview of the new C++, so the focus is on breadth rather than depth. Whenever feasible, new language features are presented in a style showcasing how they improve over their "Old C++" counterparts.

Speaker: Leor Zolman, BD Software. Leor Zolman has been involved in system software/compiler development, system administration, application development, and education for 40 years, spanning the CP/M, UNIX, and Windows operating systems. Leor is the author of The BD Software C Compiler (“BDS C”, 1979), the first native-code C compiler targeted exclusively for personal computers. In the early 90’s, Leor was a member of the technical staff of R&D Publications, where he wrote columns for R&D’s magazines: The C/C++ Users Journal, Windows Developer’s Journal, and SysAdmin, and he also authored the first book ever published by R&D Books: Illustrated C. More recently, in addition to designing and delivering on-site training courses on C, C++, Java, Perl, and Unix, Leor wrote STLFilt: An STL Error Message Decryptor for C++, a Freeware tool for simplification of complex (i.e., unreadable) template-related C++ error diagnostics. When not engaged in learning or teaching C++, you may find Leor administering and participating in several financial discussions boards, riding his BMW R1200RT, playing tennis or showing people the Ring Nebula through his LX200GPS telescope at star parties around the North Shore Boston area.

AST matchers and Clang refactoring tools -- Eli Bendersky

You can do some great things when you have a reusable open-source C++ parser:

AST matchers and Clang refactoring tools

by Eli Bendersky

From the article:

Clang tooling sees lots of interest and development focus in the past few years. At last, we have a convenient, accurate, open-source and well supported framework for programmatically analyzing and refactoring C++ code; I find this very exciting.

A great outcome of this rapid pace of development is that new APIs and tools spring up all the time. For example, some time ago the Clang tooling developers figured out folks doing AST traversals have to write a lot of repetitive code to find interesting AST nodes, so they came up with a great new API called AST matchers, which I want to discuss here...

N4126: Explicitly defaulted comparison operators -- Oleg Smolsky

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

Date: 2014-07-29

Explicitly defaulted comparison operators

by Oleg Smolsky

Excerpt:

N3950 was presented to the Evolution WG at the Rapperswil meeting and the response was very positive. A later revision, N4114 was amended to handle the following points requested at the meeting:

  • Support for non-member operators
  • Mutable members: there was consensus on their treatment. The compromise is to to make explicitly defaulted operators ill-formed when mutable members are present. See "Mutable members".
  • Short-hand notation was proposed and had very positive feedback. See "The proposed syntax: short form".

This proposal makes the following changes after the technical review on the c++std-ext list:

  • Pointer, floating point and enumerated type members are included. See "Domain of the operator functions" for the discussion.
  • Each explicitly defaulted operator is independent and is bridged to the respective members' operators
  • Lexicographical comparison is defined explicitly

Quick Q: Why doesn't std::sort accept its comparator by reference? -- StackOverflow

Quick A: By design, because function objects are expected to be nonstateful values.

Recently on SO:

Why doesn't std::sort accept comparator by reference?

The standard on std::reference_wrapper explains that std::sort now accepts std::reference_wrapper, allowing one to pass a comparator by reference.

Is there a reason std::sort didn't accept the comparator by reference in the first place?

A Clang edition of the C++11/14 Rocks book is now available

Korban's C++11/14 feature overview book now has a Clang edition, in addition to VS2013 and GCC:

Clang Edition of the C++11/14 Rocks Book

by Alex Korban

From the announcement:

Do you use Clang to compile C++? Would you like to know all about the C++11 and C++14 language features it supports?

You can read about them in the new edition of my C++11/14 Rocks book tailored to Clang.

...

For those who have the GCC edition of the book: you’ll already be familiar with all the C++11 content as GCC also has full C++11 support. However, the Clang edition has full C++14 coverage instead of an overview.

CppCon Program Highlights, 9 of N: Safety

The CppCon 2014 conference program has been posted for the upcoming September conference. We've received requests that the program continue to be posted in "bite-sized" posts, a few sessions at a time, to make the 100+ sessions easier to absorb, so here is another set of talks. This series of posts will conclude once the entire conference program has been posted in this way.

 

Safety and C++ are complementary, and C++ is regularly used in safety-critical systems including with strong static analysis support across multiple popular compilers. From the latest jet fighter avionics systems to the most modern Clang sanitizers, CppCon has a number of talks in this area including the following four. As always, the talks are by Those Who Know and Those Who Do -- including in some of the world's most famous codebases.

In this post:

  • The Joint Strike Fighter Coding Standard: Using C++ on Mission and Safety Critical Platforms
  • Sanitize your C++ code
  • Exception-Safe Code
  • 0xBADC0DE

 

The Joint Strike Fighter Coding Standard: Using C++ on Mission and Safety Critical Platforms

The Joint Strike Fighter (JSF) is the first major DOD aircraft program to use C++. Much of this software is either safety critical or mission critical and so must be written in such a way as to be clear, readable, unambiguous, testable, and maintainable. We discuss the driving requirements behind the standard and its evolution. We give a quick overview of our standard and discuss how it differs from later standards such as MISRA C++. We discuss lessons learned over our nine year history of applying the standard to a large embedded software program. We also address ambiguities in rules and difficulties with automated checking of conformance with the standard.

Speaker: Bill Emshoff, Senior Staff Software Engineer, Lockheed Martin. Bill Emshoff has been programming in C++ for over 12 years. He is currently a Senior Staff Software Engineer working on the Joint Strike Fighter program at Lockheed Martin, where he has evolved to become an informal interpreter of the JSF coding standard and champion of static analysis as a means to catch and prevent coding errors prior to formal test.

 

Sanitize your C++ code

"Sanitizers" is a family of dynamic testing tools built into C++ compilers (Clang and GCC):•AddressSanitizer finds memory errors, such as use-after-free, buffer overflows, and leaks;

  • ThreadSanitizer finds data races, deadlocks, and other threading bugs;
  • MemorySanitizer finds uses of uninitialized memory;
  • UndefinedBehaviorSanitizer finds other kinds of undefined behavior, such as use of incorrect dynamic type, shift by illegal amount and many others.

You will learn how these tools work, how to use them on small programs and how we deploy them in large projects.

Speaker: Kostya Serebryany, Software Engineer, Google. Konstantin (Kostya) Serebryany is a Software Engineer at Google. His team develops and deploys dynamic testing tools, such as AddressSanitizer and ThreadSanitizer. Prior to joining Google in 2007, Konstantin spent 4 years at Elbrus/MCST working for Sun compiler lab and then 3 years at Intel Compiler Lab. Konstantin holds a PhD from mesi.ru and a Master from msu.ru.Twitter handle: @kayseesee

 

Exception-Safe Code

Are you 100% confident that your code is exception-safe?

Safe usage of exceptions is a non-trivial problem that the industry has struggled with for the better part of two decades. If you have fear, uncertainty, or doubt about exception safety or just want to see the best practices for using exceptions in C++ and/or C++11/14, this session is for you. We'll start with "What is the problem we are trying to solve?" and discuss alternatives, acknowledge the challenges associated with exception usage, and cover some well-meaning but misguided attempts at safety. I will then present a set of guidelines that are the basis for safe exception usage and solid implementation techniques, including how to transition from an exception-unsafe legacy code base.

When we are finished you will know how to produce code that is easier to write, easier to understand, faster, and 100% robust in the face of exceptions.

Speaker: Jon Kalb Jon has been programming in C++ for over twenty years. During the last two decades he has written C++ for Apple, Dow Chemical, Intuit, Lotus, Microsoft, Netscape, Sun, Yahoo! and some less well­‐known companies. He taught C++ in the graduate school at Golden Gate University for three years and is a founding moderator of the Boost‐User and Boost‐Interest mailing lists.

Jon is active in the Silicon Valley chapter of the ACCU and programs the C++ track at the Silicon Valley Code Camp.

 

0xBADC0DE

My motivation for this talk is my own experience as a freelancer and trainer. I have seen a lot of good and bad code in different places. As a freelancer I often had to deal with different, unknown and often large codebases. This talk tries not only to show examples of bad code, but also to analyze why it exists in the first place, and how to deal with it or fix it. I'll visit anti-patterns, but this talk is not about anti-patterns, as that would only spotlight one of the many problems.

Speaker: Jens Weller Jens is a longtime C++ expert and the organizer of the European C++ conference Meeting C++.