lambdas

More Lambda Features with C++20

Lambdas in C++20 can be default-constructed and support copy-assignment when they have no state. Lambdas can be used in unevaluated contexts. Additionally, they detect when you implicitly copy the this pointer. This means a significant cause of undefined-behavior with lambdas is gone.

Read more
Tags: lambdas, C++20
Views: 6553

More Powerful Lambdas with C++20

Thanks to C++20, lambdas become more powerful. From the various lambda improvements, template parameters for lambdas are my favorite ones.

Read more
Views: 9239

C++ Insights - Lambdas

Honestly, many programmers in my classes have issues with the syntactic sugar of lambdas. Desugaring lambdas with C++ Insights helps quite often.

Read more
Tags: lambdas
Views: 15672

C++ Core Guidelines: Pass Function Objects as Operations

An interface is a contract between a user and an implementer and should, therefore, be written with great care. This holds also true if you pass an operation as an argument.

Read more
Views: 17617

C++ Core Guidelines: To Switch or not to Switch, that is the Question

At first, I have to apologize. Today, I wanted to continue my journey through the C++ Core Guidelines with the arithmetic expressions. In my seminar in this week, we had a long discussion about switch statements in C/C++ and how they become totally unmaintainable. Honestly, I'm not a fan of the switch statements and I have to say: there is life after the switch statements.

Read more
Views: 33443

C++ Core Guidelines: Function Objects and Lambdas

I can not think about modern C++ without lambda expressions. So my wrong assumption was that they are a lot of rules for lambda expressions. Wrong! There are less than ten rules. But as ever I learned something new.

Read more
Views: 60892

Functional in C++11 and C++14: Dispatch Table and Generic Lambdas

My favourite example the dispatch table shows how nice the features in modern C++ work together. A dispatch table is a table of pointers to functions. In my case, it is a table of handles to polymorphic function wrappers.

Read more
Tags: lambdas
Views: 57897

My Newest E-Books

Course: Modern C++ Concurrency in Practice

Course: C++ Standard Library including C++14 & C++17

Course: Embedded Programming with Modern C++

Course: Generic Programming (Templates)

Course: C++ Fundamentals for Professionals

Subscribe to the newsletter (+ pdf bundle)

Blog archive

Source Code

Visitors

Today 3806

Yesterday 7709

Week 27902

Month 186333

All 5055647

Currently are 178 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments