November 2016

Give Visual C++ a Switch to Standard Conformance--Andrew Pardoe

The Visual C++ Team is excited to announce that the compiler in Visual Studio 2017 RC will feature a mode much closer to ISO C++ standards conformance than any time in its history:

Give Visual C++ a Switch to Standard Conformance

by Andrew Pardoe

From the article:

The Visual C++ Team is previewing a compiler mode whereby longstanding non-conforming C++ constructs are rejected.  This includes fixes to pre-C++11 non-conformance bugs that affect a significant amount of existing code...

Lambda Magic ✨ -- Adi Shavit

Are C++ lambdas magical?

Lambda Magic ✨

by Adi Shavit

From the article:

 

"Like fairies, captureless lambdas are pure and magical creatures.
Unlike fairies, captureless lambdas can be converted to function pointers."

6 Tips to supercharge C++11 vector performance--Deb Haldar

Discussion on how we can efficiently use std::vector<T> container.

6 Tips to supercharge C++11 vector performance

by Deb Haldar

From the article:

Vector is like the swiss army knife of C++ STL containers. In the words of Bjarne Stroutsoup – “By default, use Vector when you need a container”. For mere mortals like us, we take this as gospel and just run with it. However, Vector is just a tool and like any tool, it can be used both effectively or ineffectively.

In this article we’ll look at 6 ways to optimize usage of vectors. We’ll look at both efficient and inefficient ways to perform the most common programming tasks using vectors, measure the performance gain we obtain by using vectors efficiently and try to understand why we’re getting the performance gain.

Help me sort out the meaning of "{}" as a constructor argument--Scott Meyers

Discussion on "Distinguish between () and {} when creating objects".

Help me sort out the meaning of "{}" as a constructor argument

by Scott Meyers 

From the article:

My experiments showed that one factor affecting whether "{{}}" as an argument list yields a zero-length std::initializer_list<T> was whether T had a default constructor, so I threw together some test code involving three classes, two of which could not be default-constructed. I then used both "({})" (note the outer parentheses) and "{{}}" as argument lists to a constructor taking a std::initializer_list for a template class imaginatively named X. When the constructor runs, it displays the number of elements in its std::initializer_list parameter.

CppCast Episode 79: Cppcheck with Daniel Marjamäki

Episode 79 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Daniel Marjamäki to talk about developing the CppCheck static analysis tool.

CppCast Episode 79: Cppcheck with Daniel Marjamäki

by Rob Irving and Jason Turner

About the interviewee:

Daniel lives in Stockholm, Sweden with his wife and son. He has a degree in electronics but has never worked as an electronics engineer. Daniel works as a consultant at Evidente in Sweden which provides consultants and contractors for embedded software development and static analysis. Daniel started Cppcheck almost 10 years ago as a hobby project that he works on in his spare time. Daniel sometimes works on other hobby projects such as an open source retro mobile phone with a rotary dial plate instead of buttons or a screen.

Trip report: Fall ISO C++ standards meeting (Issaquah) -- Herb Sutter

A trip report from the just-concluded ISO C++ meeting:

Trip report: Fall ISO C++ standards meeting (Issaquah)

by Herb Sutter

From the article:

Draft C++17 hit its major feature-freeze at our previous meeting, and over the summer we conducted its major ISO comment ballot. So the primary focus at this meeting was addressing the review comments. Think of it as the “shakedown” stage of fixing bugs before release.

We expected to take two meetings to resolve all the comments, and we are on track. So at our next meeting we hope to finish addressing the ballot comments and any other fixes we can resolve and hopefully set C++17 in stone as we send it out for its possibly-final formal approval ballot. 

... Besides resolving C++17 ballot comments, we also worked on the TSes: We completed one, sent two out for their main ballots, and have two more expected to go out for their main ballots at the next meeting. ... A lot of our C++ standardization work is reaching “ship stage” at about the same time, which is pretty exciting to see, so we’re in the middle of a busy handful of meetings. 

When type inference fails -- Krzysztof Ostrowski

C++11 re-introduces auto keyword that enables basic type inference. Using auto not only improves code readability.

When type inference fails

by Krzysztof Ostrowski

From the article:

Use of type inference puts impact on what is possible to be done with certain value, i.e. on its interface or concept it models, rather than on its concrete type. Unfortunately, auto does type inference locally, thus is not such powerful as we might expect. Here follows some examples of auto-inference failures.