CppCon 2019 Trip Report and Slides--Anthony Williams
Check it out!
CppCon 2019 Trip Report and Slides
by Anthony Williams
From the article:
Having been back from CppCon 2019 for over a week, I thought it was about time I wrote up my trip report...
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 3-8, Kona, HI, USA
By Adrien Hamelin | Oct 2, 2019 11:20 AM | Tags: community
Check it out!
CppCon 2019 Trip Report and Slides
by Anthony Williams
From the article:
Having been back from CppCon 2019 for over a week, I thought it was about time I wrote up my trip report...
By Adrien Hamelin | Oct 2, 2019 11:14 AM | Tags: community
The series continues.
C++ Core Guidelines: Bounds Safety
by Rainer Grimm
From the article:
Today's post is about the second profile of the C++ Core Guidelines: Bounds Safety. The goal of the profile bounds safety is it that you operate inside the bounds of allocated memory...
By rodburns | Oct 1, 2019 01:57 PM | Tags: None
This blog post offers an interesting solution for replacing function pointers with function objects and lambdas.
Alternatives to C++ Function Pointers in SYCL using Function Objects
by Georgi Mirazchiyski
From the article:
Function Pointers are a feature of the C language and so form part of the C++ standard. As such, a function pointer allows the following behavior:
"A pointer to a function can be passed as a parameter to another function"
In C++, especially in modern C++, function pointers are a legacy feature from the C language but they still exist in some code bases.
SYCL enables single source development where template functions can contain both host and device code to construct complex algorithms that use acceleration. However, SYCL does not provide support for function pointers since this is a limitation posed by the design of OpenCL v1.2 which is the basis of the current SYCL v1.2.1 definition.
But there is good news, we can use modern C++ to implement a solution that can be used with SYCL. SYCL is built with C++11 (and onward depending on the implementation), meaning features like anonymous functions known as "lambdas" can be used with little to zero overhead. Even going back to C++98/03 it is possible to use function objects defined as either structs or classes, and additionally, you can template your operation (the computation logic) to provide a generic way to consume the function objects or lambdas.
By Adrien Hamelin | Sep 26, 2019 11:05 AM | Tags: experimental c++11
Surprise!
String literals make bad ranges
by Andrzej Krzemieński
From the article:
C++20 will come with what we call “Ranges” library. Meanwhile, range interface has been supported ever since C++11 in one context: range-based for loop. A range-based for loop can detect anything that is a range and work with it. In particular, it can work with string literals...
By Adrien Hamelin | Sep 25, 2019 10:02 AM | Tags: advanced
Only for special cases.
C++ Tricks: Fast RTTI and Dynamic Cast
by Samuel Kahn
From the article:
As introduced in the first post of these series, I will share the first piece of KCL: an implementation of RTTI and Dynamic Cast. The code can be found on GitHub.
If you don’t know what dynamic casting is, then I suggest you read some online resources before diving into this article...
By Adrien Hamelin | Sep 24, 2019 10:49 AM | Tags: efficiency community
Compiler checks are the best!
Expressive Code for State Machines in C++
by Valentin Tolmer
From the article:
Have you ever run into this kind of comments?
// IMPORTANT: Do not call this function before calling SetUp()!Or checks like these:
if (my_field_.empty()) abort();Those are all symptoms of a (often light-weight) protocol that our code must respect. Or sometimes, you have an explicit protocol that you’re following, such as in the implementation of an SSL handshake or other business logic. Or maybe you have an explicit state machine in your code, with the transitions checked each time against a list of possible transitions.
Let’s have a look at how we can expressively handle these cases...
By Adrien Hamelin | Sep 24, 2019 10:44 AM | Tags: community
Another one.
C++ Core Guidelines: Type Safety by Design
by Rainer Grimm
From the article:
What does that mean: type safety by design. Type safety by design just means, that you always initialise your variables, use std::variant instead of a union, or prefer variadic templates and fold expressions to va_arg's...
By Adrien Hamelin | Sep 24, 2019 10:39 AM | Tags: intermediate c++11
What do you think?
How C++ ‘using’ or alias-declaration is better than typedef
by nextptr
From the article:
Alias-declaration or type-alias with 'using' statement offers a more flexible way to define type aliases than typedef, mainly because of alias templates...
By Sergey Platonov | Sep 23, 2019 12:52 PM | Tags: None
C++ Russia 2019 Piter will be held in Saint-Petersburg, October 31 – November 1, 2019.
C++ Russia 2019
From the article:
Two days, three tracks and dozens of in-depth technical talks about C++: concurrency, performance, architecture, environment — all you need to make your code perfect.
Keynote by Sean Parent, Eric Niebler and Ivan Čukić.
Also at the conference: Marshall Clow, Björn Fahller, Maxim Khizhinsky, Hana Dusíková, Rainer Grimm and many others.
C++ Russia is not only the talks but also networking with hundreds of colleagues from Russia and Europe. Due to dedicated discussion zones, all the speakers have after their talks, all the questions will be answered.And in the evening you can participate in BoF-sessions where the most uncommon ideas are born.
Fourteen talks will be entirely in English.
By Adrien Hamelin | Sep 23, 2019 11:58 AM | Tags: community
What do you think about it?
De-fragmenting C++: Making Exceptions and RTTI More Affordable and Usable
by Herb Sutter
From the video:
A fundamental reason why C++ is successful and loved is its adherence to Stroustrup’s zero-overhead principle: You don’t pay for what you don’t use, and if you do use a feature you can’t reasonably code it better by hand. In the C++ language itself, there are only two features that violate the zero-overhead principle, exception handling and RTTI – and, unsurprisingly, these are also the only two C++ language features that every C++ compiler has switches to turn off and that are regularly discouraged or even banned. This matters because not using these features is the largest current cause of fragmentation of the C++ community into incompatible dialects, and the cause of recurring problems including type confusion security vulnerabilities arising from “didn’t down-cast using dynamic_cast because that would be too slow.” This talk is about ongoing long-term efforts to try to unify the community in this area, not by replacing exceptions and RTTI, but by doubling down: fully embracing exceptions and RTTI, and improving them so they can be zero-overhead too.