Join the Maryland C++ User Group

If you live in the area.

Join the Maryland C++ User Group

From the article:

After looking for and failing to find a C++ user group in Maryland, I decided to start one. If you live in the Baltimore/DC/NoVA area, use C++ for work or pleasure, and are interested in attending monthly-ish meetings related to C++, please join the meetup group at https://meetup.com/CppMaryland/. Topics for discussion will include current (C++11/14/17) features, the upcoming C++20 standard, build tools, standard containers and algorithms, design patterns, and pretty much anything else that might benefit a C++ developer...

Alternatives to C++ Function Pointers in SYCL using Function Objects -- Georgi Mirazchiyski

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.

 

C++ Tricks: Fast RTTI and Dynamic Cast--Samuel Kahn

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...

Expressive Code for State Machines in C++--Valentin Tolmer

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...

C++ Russia 2019 Piter

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.