Better template support and error detection in C++ Modules with MSVC 2017 version 15.9--Cameron DaCa

It continues to improve.

Better template support and error detection in C++ Modules with MSVC 2017 version 15.9

by Cameron DaCamara

From the article:

It has been a long time since we last talked about C++ Modules. We feel it is time to revisit what has been happening under the hood of MSVC for modules.

The Visual C++ Team has been dedicated to pushing conformance to the standard with a focus on making the overall compiler implementation more robust and correct with the rejuvenation effort. This rejuvenation effort has given us the ability to substantially improve our modules implementation. We’ve mostly done this work transparently over the past few months until now. We are proud to say the work has reached a point where talking about it would hopefully provide developers with even more reasons to use C++ Modules with MSVC!

CppCast Episode 177: BDD, TDD, Low Latency and CppCon with Lenny Maiorani

Episode 177 of CppCast the first podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Lenny Maiorani to discuss TDD, BDD, Low Latency and CppCon moving to Denver.

CppCast Episode 177: BDD, TDD, Low Latency and CppCon with Lenny Maiorani

by Rob Irving and Jason Turner

About the interviewee:

Lenny has been using C++ off and on since 1995. Since graduating from SUNY Plattsburgh with a degree in Computer Science, he has been working at startups focused on high-throughput applications. About 2 years ago he joined Quantlab and discovered a different type of high-performance computing in low latency systems. Lenny lives in Denver, Colorado with his wife Lexey and their dog. He can be found hiking in the Colorado mountains while thinking about container access patterns and wondering if std::map can be renamed to std::ordered_map.

How to Design Function Parameters That Make Interfaces Easier to Use (2/3)--Jonathan Boccara

Agree with the logic?

How to Design Function Parameters That Make Interfaces Easier to Use (2/3)

by Jonathan Boccara

From the article:

Let’s continue exploring how to design function parameters that help make both interfaces and their calling code more expressive.

If you missed on the previous episode of this topic, here is what this series of articles contains:

  • Part 1: interface-level parameters, one-parameter functions, const parameters,
  • Part 2: calling contexts, strong types, parameters order,
  • Part 3: packing parameters, processes, levels of abstraction.

How to Boost Performance with Intel Parallel STL and C++17 Parallel Algorithms--Bartlomiej Filipek

Another one.

How to Boost Performance with Intel Parallel STL and C++17 Parallel Algorithms

by Bartlomiej Filipek

From the article:

C++17 brings us parallel algorithms. However, there are not many implementations where you can use the new features. The situation is getting better and better, as we have the MSVC implementation and now Intel’s version will soon be available as the base for libstdc++ for GCC.

Since the library is important, I’ve decided to see how to use it and what it offers...

Python-Like enumerate() In C++17--Nathan Reed

Handy little piece of code.

Python-Like enumerate() In C++17

by Nathan Reed

From the article:

Python has a handy built-in function called enumerate(), which lets you iterate over an object (e.g. a list) and have access to both the index and the item in each iteration. You use it in a for loop, like this:

for i, thing in enumerate(listOfThings):
    print("The %dth thing is %s" % (i, thing))

Iterating over listOfThings directly would give you thing, but not i, and there are plenty of situations where you’d want both (looking up the index in another data structure, progress reports, error messages, generating output filenames, etc).

C++ range-based for loops work a lot like Python’s for loops. Can we implement an analogue of Python’s enumerate() in C++? We can!

AWS launches the C++ lambda runtime

aws.PNGMore C++ and the cloud:

Introducing the C++ Lambda Runtime

by Chris Munns

From the article:

Today, AWS Lambda announced the availability of the Runtime API. The Runtime API allows you to write your Lambda functions in any language, provided that you bundle it with your application artifact or as a Lambda layer that your application uses.

As an example of using this API and based on the customer demand, AWS is releasing a reference implementation of a C++ runtime for Lambda. This C++ runtime brings the simplicity and expressiveness of interpreted languages while maintaining the superiority of C++ performance and low memory footprint. These are benefits that align well with the event-driven, function-based, development model of Lambda applications...

Quick Q: Regarding shared_ptr reference count block

Quick A: it is an implementation detail for the std.

Recently on SO:

Regarding shared_ptr reference count block

(1) Regarding size: How can I programatically find the exact size of the control block for a std::shared_ptr?

There is no way. It's not directly accessible.

(2) Regarding logic: Additionally, boost::shared_ptr mentions that they are completely lock-free with respect to changes in the control block.(Starting with Boost release 1.33.0, shared_ptr uses a lock-free implementation on most common platforms.) I don't think std::shared_ptr follows the same - is this planned for any future C++ version? Doesn't this also mean that boost::shared_ptr is a better idea for multithreaded cases?

Absolutely not. Lock-free implementations are not always better than implementations that use locks. Having an additional constraint, at best, doesn't make the implementation worse but it cannot possibly make the implementation better.

Consider two equally competent programmers each doing their best to implement shared_ptr. One must produce a lock-free implementation. The other is completely free to use their best judgment. There is simply no way the one that must produce a lock-free implementation can produce a better implementation all other things being equal. At best, a lock-free implementation is best and they'll both produce one. At worse, on this platform a lock-free implementation has huge disadvantages and one implementer must use one. Yuck.