C++ STL algorithm - transform algorithm | Modern Cpp Series Ep. 161

preview_player
Показать описание

►Lesson Description: In this lesson I show you a popular STL algorithm -- transform! Transform is effectively 'map' in other programming languages (but in C++ we have a data structure already called 'map'). Transform is very similar to for_each, but does not necessarily gaureentee elements will be executed one after the other. Transform can also take in multiple collections and a binary predicate to perform the transformation as well.

►Please like and subscribe to help the channel!
Рекомендации по теме
Комментарии
Автор

Very à propos, Mike. I recently used transform here: transform(user_input.begin(), user_input.end(), user_input.begin(), tolower); vs. using the Boost library or digging down to C-style code using 'tolower'. It was much easier to implement in D than in C++ In any case, I really learned additional features from your video!

GaryChike
Автор

I actually learning the difference between begin and cbegin from your video. Great video!

shayaxelrod
Автор

Thank you! Each of your modern videos is such a treat and eagerly awaited

VoidloniXaarii
Автор

I'm looking for existing C++ methods that are similar to the Linq methods in C#. This looks similar to the "Select()" method to me. Does the output have to the same type as the input? For example, could you transform a collection of integers (1, 2, 3) to a collection of ASCII characters (a, b, c)?

markbennett
Автор

(1:20 A urinary operation? Lol.) Thanks for the info

scififan
Автор

I'm so excited you did this video 🎉🎉🎉

damondouglas