I don't get that people keep showing that tolowercase example like they do. When I use it, the compiler *always* warns and even errors, since I use pretty strict error flags. tolower both uses and returns an int.
Wouldn't the std::equal implementation in terms of std::zip_reduce/std::transform_reduce (with std::logical_and and std::equal_to) be worse than MSVC's raw loop or the std::mismatch implementation, since it will not break out of the loop early if possible? Awesome talk!
Slide 111 - this is explaining how partition impl works: stackoverflow.com/questions/19778256/standard-library-partition-algorithm and explains why the impl on slide 111 also works.
I think std::string::makeLower() (so: mytext.makeLower(); ) would be much more logical and readible to have, than to use an algorithm... supply begin and end of string etc... . Still wonder, why does std::string not contain such a basic function? Same counts for more classes. Like nice to have std::vector::reverse(). Find it even strange to call a makeLower-function an algorithm.
I think the design of the STL is to provide such functionality as a freestanding function operating on an iterator pair instead of a member function as in classic OO. And the std library of C++ is build on this idea, rather then providing an OO interface to users.
This is the “Talk of the year” 2019 for me 👍👍
Algorithm Intuition now this is the term of the year for me 👏
Fantastic talk. going to keep std::transform in my brains level 1 cache from now on.
Really outstanding lesson, bravo.
Link to the "prequel" to this talk if interested: ua-cam.com/video/48gV1SNm3WA/v-deo.html
again! as impressive as the first one!
I don't get that people keep showing that tolowercase example like they do. When I use it, the compiler *always* warns and even errors, since I use pretty strict error flags. tolower both uses and returns an int.
Wouldn't the std::equal implementation in terms of std::zip_reduce/std::transform_reduce (with std::logical_and and std::equal_to) be worse than MSVC's raw loop or the std::mismatch implementation, since it will not break out of the loop early if possible?
Awesome talk!
Slide 111 - this is explaining how partition impl works: stackoverflow.com/questions/19778256/standard-library-partition-algorithm and explains why the impl on slide 111 also works.
I think std::string::makeLower() (so: mytext.makeLower(); ) would be much more logical and readible to have, than to use an algorithm... supply begin and end of string etc... . Still wonder, why does std::string not contain such a basic function? Same counts for more classes. Like nice to have std::vector::reverse(). Find it even strange to call a makeLower-function an algorithm.
I think the design of the STL is to provide such functionality as a freestanding function operating on an iterator pair instead of a member function as in classic OO. And the std library of C++ is build on this idea, rather then providing an OO interface to users.
I think that's what Sedgwick calls fat/slick interfaces
42:53 std::transform doesn't guarantee in-order execution. This is not a standard conform solution.
I believe It does since C++17.