Skip to main content
  1. Categories/

C++

2024


Piecewise Tuple

·3 mins
Creating a std::pair-like piecewise tuple

2018


2013


std::unique_ptr usage

·1 min

If you’re new to C++11, this post on Stackoverflow answers the question “How do I pass a unique_ptr argument to a constructor or a function?” going through each case:

  • by value
  • by non-const l-value reference
  • by const l-value reference
  • by r-value reference

async and await in C++

·1 min

I’ve just watched Herb Sutter‘s talk on C++ in Visual Studio 2013 and onwards.

The last quarter of the talk was concerned with Microsoft introducing the __async and __await keywords in a similar implementation to that already used in C#, note the __ prefix.

As he explained, this is going to be an implementation of a proposed feature for inclusion in a future version of C++, much like the modules feature currently being implemented in CLang.

The Visual Studio roadmap was intertesting, but it looks like we’re going to have to wait a while for generic lambdas.