Dealing with aliasing using contracts - Gábor Horváth - Meeting C++ 2018
Next Video from Meeting C++ 2018:
Dealing with aliasing using contracts
by Gábor Horváth
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 3-8, Kona, HI, USA
By Meeting C++ | Feb 11, 2019 10:27 AM | Tags: performance meetingcpp intermediate efficiency c++20 basics advanced
Next Video from Meeting C++ 2018:
Dealing with aliasing using contracts
by Gábor Horváth
By Sumant | Feb 11, 2019 01:54 AM | Tags: None
Do you unit test your C++ templates? It may be tricky as sometimes it's not clear how to inject mock code into a template. Traits can help!
Unit Testing C++ Templates and Mock Injection Using Traits
by Sumant Tambe
About the Article:
Unit testing your template code comes up from time to time. (You test your templates, right?) Some templates are easy to test. No others. Sometimes it's not clear how to about injecting mock code into the template code that's under test. I've seen several reasons why code injection becomes challenging.
By Meeting C++ | Feb 1, 2019 06:40 AM | Tags: usergroups meetingcpp community
The monthly overview about upcoming C++ User Group meetings at Meeting C++
C++ User Group meetings in February
by Jens Weller
By bfilipek | Jan 29, 2019 12:31 PM | Tags: None
The next episode of the ‘most useful C++ links’ is now available:

C++ Links #16
by Bartlomiej Filipek and Wojciech Razik
From the article:
See the most important and useful articles, podcasts and videos that happen between 19th and 25th of January 2019.
This week you will find a link to a ray-tracer, real-life examples of ranges, new useful features of Microsoft Visual Studio and many more!
By Adrien Hamelin | Jan 25, 2019 12:42 PM | Tags: performance advanced
Optimising accesses.
Variant Visitation V2
by Michael Park
From the article:
In 2015, I wrote an article titled Variant Visitation which described an implementation strategy for std::visit. The approach involved a matrix of function pointers, and many have raised concerns regarding poor code-gen caused by optimization limitations of function pointers on some compilers.
This post describes the switch-based approach implemented in mpark/variant, and its benchmark results...
By Adrien Hamelin | Jan 25, 2019 12:33 PM | Tags: intermediate c++11
Is it simpler that way?
C++ moves for people who don’t know or care what rvalues are
by Topher Winward
From the article:
When I was first learning about move semantics in C++, I kept reading articles that explained in terms of other scary sounding jargon — lvalues, rvalue references, memcpy, ownership. None of these things are strictly necessary to know about to understand the core of move semantics. (Though, the more you learn about them, the greater your understanding of move semantics will become.)
You may have heard of move semantics, and may know that they’re “faster”, but not why, or even how to move something. (Here “moves” and “move semantics” mean the same thing.)
This article will deliberately simplify or ignore some concepts (like constructors, rvalue references, stack vs heap) to make the core idea of moving easier to follow, so don’t worry if you already know this stuff and see something that isn’t technically correct. I’ll mark clarifications for these with a number. This article is aimed at those writing everyday (non-library) code, with little to no existing understanding of move semantics, to help get over the initial conceptual hurdle...
By andyg | Jan 20, 2019 03:40 AM | Tags: None
AndyG wants us to stop misusing dynamic_cast and start using a visitor pattern
Stop reimplementing the virtual table and start using double dispatch
by AndyG
From the article:
In this tutorial, I’ll talk about one solution to this problem I’ve had some success with: the double-dispatch Visitor pattern. With it, you can trim down those long if-else if blocks, separate responsibility into manageable pieces, and even stabilize your interface better.
By Adrien Hamelin | Jan 17, 2019 01:31 PM | Tags: experimental
Exciting!
Exploring C++20 - Class Types in Non-Type Template Parameters
by Tobias Widlund
From the article:
If I had to pick out my favourite features planned for C++20, then this one would definitely be amongst the top 5 since I love compile time programming. This feature makes it more natural to write templated code since it allows you to group data together and pass it to a template without having to resort to hacks.
To explain what this feature is about, I will start by talking about normal non-type template parameters from pre-C++20...
By Adrien Hamelin | Jan 17, 2019 01:24 PM | Tags: intermediate community
In one word.
The pImpl Idiom
by Arne Mertz
From the article:
The pImpl idiom is a useful idiom in C++ to reduce compile-time dependencies. Here is a quick overview of what to keep in mind when we implement and use it...
By Adrien Hamelin | Jan 17, 2019 01:20 PM | Tags: basics
Not helping you.
Don’t pass lambdas (or other multi-line entities) as parameters to macros
by Raymond Chen
From the article:
Consider this macro:
#ifdef DEBUG #define LOG(value) LogValue(value) #else // In production, evaluate but don't log. #define LOG(value) (value) #endifThis seems not entirely unreasonable, but bad things happen if you pass a multi-line entity as the macro parameter...