C++ User Group Meetings in February
The monthly overview about upcoming C++ User Group meetings at Meeting C++
C++ User Group meetings in February
by Jens Weller
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 3-8, Kona, HI, USA
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...
By triangles | Jan 17, 2019 12:51 PM | Tags: None
Different options with different meanings.
Move smart pointers in and out functions in modern C++
by Triangles @ Internal Pointers
From the article:
Passing and returning smart pointers to/from functions are operations that require some planning. There are many ways of doing it and picking the right one is not always straightforward. Luckily for us C++ experts have guidelines that shed some light on this task.
By Lucian Radu Teodorescu | Jan 17, 2019 12:50 PM | Tags: None
How to solve the dining philosophers problem in 2018? By using tasks. And how to use tasks? Read on...
Modern dining philosophers
by Lucian Radu Teodorescu
From the article:
We give several solutions to the dining philosophers problem, each with some pros and cons. But, more importantly, we walk the reader through the most important aspects of using tasks to solve concurrency problems.
Instead of reaching for our higher-level frameworks, we opted to keep the level of abstractions as close as possible to raw tasks. This way, we hope to guide the reader to understand more about the essence of task-based programming. Our aim is to make the reader comprehend the machinery of composing tasks; those skills should be highly valuable.