July 2017

A more realistic coroutine--Kirit Sælensminde

What’s the point of coroutines?

A more realistic coroutine

by Kirit Sælensminde

From the article:

Having gotten something working, we still have a small problem. We have a coroutine that we can start, and we can choose when to suspend it, but we can't yet resume it.

The coroutines TS describes a class std::experimental::coroutine_handle which is our interface to the coroutine itself. It's a template which is supposed to be told the promise_type we're using...

5 years of Meeting C++

Meeting C++ exists now for 5 years, lets celebrate on the blog:

5 years of Meeting C++

by Jens Weller

From the article:

Just a little bit more then 5 years ago, Meeting C++ went public. Since then, it has been a wild ride and huge success. Today, Meeting C++ reaches over 50k in social media, the conference it self has grown from 150 to 600 in its 5 editions...

Meeting C++ live: C++17 with Tony van Eerd

A really great new episode about Tony van Eerd was live on YouTube, watch the recording:

Meeting C++ live: C++17 with Tony van Eerd

by Jens Weller & Tony van Eerd

Watch on YouTube:

CppCon 2017: Early bird registration ends this weekend

A reminder from the CppCon blog:

Early bird registration ends this weekend

by Jon Kalb

From the post:

No matter when you register for CppCon 2017, you be able to meet with:

  • over a thousand other professional C++ engineers, including book, blog, and library authors, standards committee members, compiler and other tool implementers, and teachers and trainers;
  • scores of the best presenters in the industry; and
  • exhibitors from all over the world

and attend:

  • five days of six or seven tracks of peer-reviewed presentations,
  • daily plenary talks from recognized industry leaders,
  • multiple lightning talk sessions,
  • expert panels and special sessions,
  • poster presentations, and
  • social events.

But if you do it this week, you save more than enough money to join us at the Boeing Future of Flight Field Trip.

To help you decide, here is this year’s promo video:

Italian C++ Conference 2017--Marco Arena

Summary and stats of the biggest C++ event in Italy:

Italian C++ Conference 2017

by Marco Arena

From the article:

Last June 17 we had the Italian C++ Conference 2017 in Milan, one of the events totally focused on C++ organized by the Italian C++ Community that I lead and manage...

 

Videos will be published soon. Further communication will follow.

My first coroutine--Kirit Sælensminde

What's the point of coroutines?

My first coroutine

by Kirit Sælensminde

From the article:

There are more and more examples coming out of how to convert things like the use of futures into coroutines, and you may be forgiven for thinking that there is also some magic that happens in boost::future or std::future that lets this work, but that's not the case.

In C++ a coroutine is any function that contains one of the coroutine keywords in its body, that is any of co_return, co_yield or co_await.

What we're going to do is to write a very basic mechanism that allows us to use co_return to return a value from a coroutine. Coroutines are really a generalisation of a function call, and what this is going to allow us to do is to treat a coroutine as a function call. If we can't do this then we don't stand much chance of doing anything more interesting with them, but it will give us a good starter on how the machinery works...

How C++ coroutines work--Kirit Sælensminde

What's the point of coroutines?

How C++ coroutines work

by Kirit Sælensminde

From the article:

If you look at coroutines in other language, JavaScript or Python for example, you'll see that the language documents how the coroutines work. How you can use co_yield and co_await etc. (however they're spelled) and what the language does for you with them. This is all very useful, and lets you do a lot of cool things with them, but always within the confines of what the language runtime allows.

In C++ they're quite different. The compiler provides a scaffolding on which you can decide how things work. This means that C++ doesn't provide generators, but it provides you a way to write a ton of different generators that work in different ways depending on your needs.

This is what this series of articles is going to be about. Not how to use or write coroutines that work according to some pre-established pattern, but how the underlying machinery allows you to customise the way that the coroutines work...

CppCon 2016: C++14 Reflections Without Macros, Markup nor External Tooling..--Antony Polukhin

Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:

C++14 Reflections Without Macros, Markup nor External Tooling..

by Antony Polukhin

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

C++ was lacking the reflections feature for a long time. But a new metaprogramming trick was discovered recently: we can get some information about POD structure by probing it's braced initializes. Combining that trick with variadic templates, constexpr functions, implicit conversion operators, SFINAE, decltype and integral constants we can count structure's fields and even deduce type of each field.

Now the best part: everything works without any additional markup nor macros typically needed to implement reflections in C++.

In this talk I'll explain most of the tricks in detail, starting from a very basic implementation that is only capable of detecting fields count and ending up with a fully functional prototype capable of dealing with nested PODs, const/volatile qualified pointers, pointers-to-pointers and enum members. Highly useful use-cases will be shown a the end of the talk. You may start experimenting right now using the implementation at https://github.com/apolukhin/magic_get.

Modern C++ Programming Cookbook Review

Review of a new book about Modern C++

Modern C++ Programming Cookbook Review

by Bartlomiej Filipek

From the article:

The book is good addition to any C++ bookshelf. It’s well suited for the target audience: even if you’re an expert, you’ll get a chance to refresh your knowledge and update it with C++14/C++17 content. And If you’ve just finished some beginner book, you’ll find here topics that will move you forward.