CppCon 2015 Ranges for the Standard Library--Eric Niebler

Have you registered for CppCon 2016 in September? Don’t delay – Early Bird registration is open now.

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

Ranges for the Standard Library

by Eric Niebler

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Range-based interfaces are functional and composable, and lead to code that is correct by construction. With concepts and ranges coming to the STL, big changes are in store for the Standard Library and for the style of idiomatic C++. The effort to redefine the Standard Library is picking up pace. Come hear about one potential future of the STL from one of the key people driving the change.

CppCon 2015 Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!--Chandler Carruth

Have you registered for CppCon 2016 in September? Don’t delay – Early Bird registration is open now.

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

Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!

by Chandler Carruth

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

A primary use case for C++ is low latency, low overhead, high performance code. But C++ does not give you these things for free, it gives you the tools to control these things and achieve them where needed. How do you realize this potential of the language? How do you tune your C++ code and achieve the necessary performance metrics?

This talk will walk through the process of tuning C++ code from benchmarking to performance analysis. It will focus on small scale performance problems ranging from loop kernels to data structures and algorithms. It will show you how to write benchmarks that effectively measure different aspects of performance even in the face of advanced compiler optimizations and bedeviling modern CPUs. It will also show how to analyze the performance of your benchmark, understand its behavior as well as the CPUs behavior, and use a wide array of tools available to isolate and pinpoint performance problems. The tools and some processor details will be Linux and x86 specific, but the techniques and concepts should be broadly applicable.

Quick Q: Is this std::ref behaviour logical?

Quick A: Yes, std::ref can be reassigned (see example)

Recently on SO:

Is this std::ref behaviour logical?

A small modification to f2 provides the clue:

template<class T>
void f2(T arg)
{
    arg.get() = xx;
}

This now does what you expect.

This has happened because std::ref returns a std::reference_wrapper<> object. The assignment operator of which rebinds the wrapper. (see http://en.cppreference.com/w/cpp/utility/functional/reference_wrapper/operator%3D)

It does not make an assignment to the wrapped reference.

In the f1 case, all is working as you expected because a std::reference_wrapper<T> provides a conversion operator to T&, which will bind to the implicit right hand side of ints implicit operator+.

cppformat 3.0.0 and becomes fmt--Victor Zverovich

A new versionb of fmt is out:

cppformat 3.0.0 and becomes fmt

by Victor Zverovich

From the release:

The project has been renamed from C++ Format (cppformat) to fmt for consistency with the used namespace and macro prefix (#307). Library headers are now located in the fmt directory:

#include "fmt/format.h"

Including format.h from the cppformat directory is deprecated but works via a proxy header which will be removed in the next major version. The documentation is now available at http://fmtlib.net...

CppCast Episode 56: Conan with Diego Rodriguez-Losada

Episode 56 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Diego Rodriguez-Losada from Conan to discuss the new C++ Package Manager.

CppCast Episode 56: Conan with Diego Rodriguez-Losada

by Rob Irving and Jason Turner

About the interviewee:

Diego's passions are robotics and SW development. He has developed many years in C and C++ in the Industrial, Robotics and AI fields. He was also a University (tenure track) professor till 2012, when he quit academia to try to build a C/C++ dependency manager, co-founded startup biicode, since then mostly developing in Python. Now he is working as freelance and having fun with conan.io.

Introducing a new, advanced Visual C++ code optimizer--Gratian Lup

Visual C++ compiler evolves again:

Introducing a new, advanced Visual C++ code optimizer

by Gratian Lup

From the article:

We are excited to announce the preview release of a new, advanced code optimizer for the Visual C++ compiler backend. It provides many improvements for both code size and performance, bringing the optimizer to a new standard of quality expected from a modern native compiler.

This is the first public release and we are encouraging people to try it and provide suggestions and feedback about potential bugs. The official release of the new optimizer is expected to be Visual Studio Update 3, while the release available today is unsupported and mostly for testing purposes...

CppCon 2015 Better Code: Data Structures--Sean Parent

Have you registered for CppCon 2016 in September? Don’t delay – Early Bird registration is open now.

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

Better Code: Data Structures

by Sean Parent

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

The standard library containers are often both misused and underused. Instead of creating new containers, applications are often structured with incidental data structures composed of objects referencing other object. This talk looks at some of the ways the standard containers can be better utilized and how creating (or using non-standard library) containers can greatly simplify code. The goal is no incidental data structures.

CppCon 2015 Writing Good C++14... By Default--Herb Sutter

Have you registered for CppCon 2016 in September? Don’t delay – Early Bird registration is open now.

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

Writing Good C++14... By Default

by Herb Sutter

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Modern C++ is clean, safe, and fast. It continues to deliver better and simpler features than were previously available. How can we help most C++ programmers get the improved features by default, so that our code is better by upgrading to take full advantage of modern C++?

This talk continues from Bjarne Stroustrup’s Monday keynote to describe how the open C++ core guidelines project is the cornerstone of a broader effort to promote modern C++. Using the same cross-platform effort Stroustrup described, this talk shows how to enable programmers write production-quality C++ code that is, among other benefits, type-safe and memory-safe by default – free of most classes of type errors, bounds errors, and leak/dangling errors – and still exemplary, efficient, and fully modern C++.

Background reading: Bjarne Stroustrup’s 2005 “SELL” paper, “A rationale for semantically enhanced library languages," is important background for this talk.