advanced

A flexible lexicographical comparator for C++ structs--Björn Fahller

An interesting article:

A flexible lexicographical comparator for C++ structs

by Björn Fahller

From the article:

We've all hand crafted comparison operators for structs with many members, and we've all cursed the tedium. It's all right for equality comparison, but lexicographical ordering relations is a different story when there are more than two members.

Hopefully all C++ developers have by now learned about the std::tie()-idiom.

struct S
{
  int a;
  int b;
  int c;
};

bool operator<(const S& lh, const S& rh)
{
  return std::tie(lh.a, lh.b, lh.c)
       < std::tie(rh.a, rh.b, rh.c);
}

Both keynotes from Meeting C++ 2015 are now online!

See Chandler Carruth and Lars Knoll giving the keynotes at Meeting C++ this year:

Both Keynotes from Meeting C++ 2015 are online!

by Jens Weller

From the article:

Great news: Since yesterday, both of the keynotes from this years Meeting C++ conference are on youtube! Both keynote speakers chose to speak on a specific topic, and delivered very well. There is also a playlist for Meeting C++ 2015.

Overload 130 is now available

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

Overload 130 / PDF

From the journal

Type Mosaicing with Consultables and Delegates

If several classes need to work together lots of boilerplate code is often needed. Nicolas Bouillot introduces type mosaicing to avoid this.

The Universality and Expressiveness of std::accumulate

Folding is a highly generic operation available through std::accumulate. Paul Keir goes beyond reduction, with the help of C++14’s polymorphic lambdas.
QM Bites – The two sides of Boolean Parameters
Boolean parameters are tempting but make life difficult. Matthew Wilson advises us to avoid them (almost) all the time.
Identify your Errors better with char[]
Error codes still get used instead of exceptions. Patrick Martin and Dietmar Kühl consider how to use char arrays for better information.
CPU Clocks and Clock Interrupts, and Their Effects on Schedulers
Instructions to sleep for a second almost never result in precisely one second’s sleep. Bob Schmidt walks us through the mechanics of why.
 

All Meeting C++ Lightning Talk videos are online

Meeting C++ just started a week ago, and I already managed to edit and upload all lightning talks:

Meeting C++ 2015 - all lightning talks are now online at youtube

by Jens Weller

From the article:

This year for the very first time we had lightning talks at the Meeting C++ conference. Two sessions with each 5 lightning talks were held...

Getting Started with Modules in C++--Kenny Kerr

The basics of creating and using a module:

Getting Started with Modules in C++

by Kenny Kerr

From the article:

Visual Studio 2015 Update 1 shipped with experimental support for a module system for C++. You can learn about it from this talk given by Gabriel Dos Reis at CppCon. Creating and consuming modules is very simple, but getting started with the compiler is not that obvious. At least it wasn’t very obvious to me, so here’s a quick introduction to get you started.

C++ Modules in VS 2015 Update 1--Gabriel Dos Reis and Andrew Pardoe

Modules in Visual:

C++ Modules in VS 2015 Update 1

by Gabriel Dos Reis and Andrew Pardoe

From the article:

The VC++ team is excited to preview a new feature in VS 2015 Update 1: The first experimental implementation of A Module System for C++, proposed for C++17. That proposal was approved by the C++ standards Evolution Working Group for a C++17 Technical Specification at the Fall 2015 meeting in Kona, Hawai’i. The draft wording for the Technical Specification is under review by the C++ Standards Core Working Group.

 

Efficient parameter pack indexing--Louis Dionne

And you, how do you index your parameter pack?

Efficient parameter pack indexing

by Louis Dionne

From the article:

Recently, I’ve been looking at ways to index into parameter packs with as little compile-time overhead as possible. This is not a new problem, and we know of several metaprogramming techniques to achieve this, some of which offer pretty good compile-times. Most of these techniques are also well documented, for example here and here. So, why write an article about this well-covered topic? Well, I recently decided to cheat and modified the compiler to see how fast we could possibly be. This article summarizes what I found.