What is the new reduce algorithm in C++17?

Learn how to allow for parallelization using the reduce algorithm, new in C++17.

By Jason Turner
February 8, 2017
Screenshot from "What is the new reduce algorithm in C++17?" Screenshot from "What is the new reduce algorithm in C++17?" (source: O'Reilly)

Reduce is one of many useful new algorithms to be introduced in C++17. In this video, Jason Turner first demonstrates the logic behind the existing accumulate algorithm. Jason then goes on to explain how the new reduce algorithm acts as an out of order version of accumulate and can be used to work around a common error. Intermediate C++ programmers will understand how the new reduce algorithm’s execution policy allows them to instruct the compiler to allow for parallelization.

Access in-depth C++ training with our Beginning C++ Learning Path.

Learn faster. Dig deeper. See farther.

Join the O'Reilly online learning platform. Get a free trial today and find answers on the fly, or master something new and useful.

Learn more

Jason Turner is a Microsoft MVP certified trainer backed by over 12 years of experience as a C++ developer. An active member of the C++ community who has spoken at CppCon and C++Now, Jason is the ongoing co-host of of CppCast, a podcast for C++ developers. Jason is also the co-creator and maintainer of the embedded C++ scripting language, ChaiScript, and the author and curator of the collaborative coding standards document, C++ Best Practices.

Post topics: Software Engineering
Post tags: Questions
Share: