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...
March 11-13, Online
March 16-18, Madrid, Spain
March 23-28, Croydon, London, UK
March 30, Kortrijk, Belgium
May 4-8, Aspen, CO, USA
May 4-8, Toronto, Canada
June 8 to 13, Brno, Czechia
June 17-20, Folkestone, UK
September 12-18, Aurora, CO, USA
November 6-8, Berlin, Germany
November 16-21, Búzios, Rio De Janeiro, Brazil
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 Adrien Hamelin | Sep 23, 2019 11:54 AM | Tags: community
The first report is already in!
CppCon 2019 Trip Report
by Matt Godbolt
From the article:
I’m on my way back from the 2019 CppCon conference and my head is buzzing with ideas! What an amazing experience!
By Vittorio Romeo | Sep 23, 2019 07:01 AM | Tags: None
This article covers a possible mechanism that would allow the C++ committee to make breaking changes to the language syntax while still fully preserving backwards compatibility. This would allow dangerous or obsolete constructs to be removed from C++, increasing safety and approachability of the language.
fixing c++ with epochs
by Vittorio Romeo
From the article:
Imagine that you have been designing a programming language for over 30 years and that it gradually became widely used across the globe. Some of the decisions you made at the beginning were excellent and contributed to the success of your project. Some others, however, were not the best: over the years you and your users realized that the world would have been a better place if those choices you made eons ago were slightly different. [...]
What if I told you that I could fix all of your problems? Even better, what if I told you that backward-compatibility will never be broken and that migration to newer versions of your language could be automated?