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.

Strict Weak Ordering and STL -- Saurabh Singh

Saurabh Singh describes in a brief tutorial on how to correctly implement the comparator function for STL containers and algorithms. 

Strict Weak Ordering and STL

by Saurabh Singh

From the article:

If you had ever used a map or set or even std::sort I bet you would have to give a comparator function. (Or an overload to the < (less than) operator).
I will try to give an overview of how certain associative stl containers use this property for ordering the elements.
Almost all stl containers rely on strict weak ordering A strict weak ordering defines the relative position of elements in terms of precedence of one item over other. For eg. if you have a room full of person and you have to form a queue based on their height, a person with "lesser" height will "precede" the person with greater height. For a function to be satisfying strict weak ordering following conditions need to be met.

The PDF version of the document is available here.