Articles & Books

Quantifiers, metaprogramming and concepts -- Nikos Athanasiou

Quantification expresses the extent to which a predicate is true over a set of elements. This installment describes the use of predicate logic in metaprogramming.

Quantifiers, metaprogramming and concepts

by Nikos Athanasiou

From the article:

Metaprograms often use predicate logic in creative ways. For example, type queries in generic code are used to constrain, dispatch, specialize, activate or deactivate code at compile time.

Overload 136 is now available

ACCU’s Overload journal of December 2016 is out. It contains the following C++ related articles.

Overload 136 is now available

From the journal:

The MirAL Story
Description : The X-Windows system is all-pervasive but struggles with security and performance graphics. Alan Griffiths introduces Mir Abstraction Layer to deal with these issues. by Alan Griffiths

Overloading with Concepts
Description : Concepts can play a role in function overloading. Andrew Sutton shows us how. by Andrew Sutton

Ultra-fast Serialization of C++ Objects
Description : Serialising and de-serialising is a common problem. Sergey Ignatchenko and Dmytro Ivanchykhin demonstrate one way to do this quickly. by Sergey Ignatchenko and Dmytro Ivanchykhin

Modern C++ Features: User-Defined Literals
Description : User-defined literals were introduced in C++11. Arne Mertz walks us through their use. by Arne Mertz

Python Streams vs Unix Pipes
Description : Dealing with an infinite sequence requires some thought. Thomas Guest presents various ways to approach such a problem. by Thomas Guest

Letter
Description : Silas S. Brown comments on Steve Love's recent article. by Silas S. Brown

Hello World in Go
Description : Go provides a way to write efficient concurrent programs in a C-like language. Eleanor McHugh shares a "Hello, world!" tutorial. by Eleanor McHugh

More Meeting C++ 2016 videos are online!

A week full of video editing brings the first batch of Meeting C++ 2016 videos online:

More videos are online!

by Jens Weller

Meeting C++ 2016 Playlist

From the article:

With today, almost all videos from the A and all videos of the D Track are online. There is a recording issue with one talk in the A track, which might get resolved in 2017. Also since today, the Meeting C++ YouTube channel has more then 400k views!

The full video set you can find in the Meeting C++ 2016 Playlist, the newest videos are easily found by visiting the Meeting C++ YouTube channel or subscribing to this RSS feed.

Path Exploration -- Adi Shavit

A short stroll along filesystem::path.

Path Exploration

by Adi Shavit

From the article:

The “experimental” Filesystem TS has been with us for a few years living in the std::experiment namespace. With C++17 it will finally be merged into std.

When noexcept?--Edouard of quasardb

A good question with a good answer.

When noexcept?

by Edouard of quasardb

From the article:

In a previous post, we had a look at the new constexpr keyword that has been introduced in C++ 11. Today we'll study another new fancy specifier: noexcept...

Simplifying templates and #ifdefs with if constexpr--Simon Brand

The new if constexpr will change a good part of our code for the better!

Simplifying templates and #ifdefs with if constexpr

by Simon Brand

From the article:

if constexpr is a C++17 feature which allows conditionally compiling code based on template parameters in a clear and minimal fashion. It is essentially an if statement where the branch is chosen at compile-time, and any not-taken branches are discarded without being instantiated...

Capturing perfectly-forwarded objects in lambdas -- Vittorio Romeo

Does [x = std::forward<decltype(x)>] behave like you expect?

capturing perfectly-forwarded objects in lambdas

by Vittorio Romeo

From the article:

Perfect forwarding and forwarding references allow developers to write generic template functions that retain the lvalueness/rvalueness of passed arguments [...] Let's try to use auto&&, std::forward and C++14's generalized lambda capture syntax to implement our desired semantics. [...] What we really want to do is:

  • Capture by copy if a is an rvalue reference.
  • Capture by reference if a is an lvalue reference.

[...]

Technical Debt - More Captureless Lambda Fun -- Adi Shavit

More interesting facts about captureless lambdas.

Technical Debt

by Adi Shavit

From the article:

The series on captureless lambdas generated some interesting comments.  
The articles discusses converting captureless lambdas into function pointers without explicitly specifying the cast-to type, calling conventions and standard conformance and a special callbackizing function for capturing lambdas.

C++ 17 Transformation...--phantom

The transformation is only a beginning towards catching up from C++98, but it does show why modern C++ features improve your code.

C++ 17 Transformation...

by phantom

From the article:

I'm basically really bad at working on my own projects, but with the recent release of Visual Studio 2017 RC and its improved C++17 support I figured it was time to crack on again...

To that end I've spent a bit of time today updating my own basic windowing library to use C++17 features. Some of the things have been simple transforms such as converting 'typedef' to 'using', others have been more OCD satisfying...