A simple workaround for the fact that std::equal takes its predicate by value--Raymond Chen
Simple and efficient.
A simple workaround for the fact that std::equal takes its predicate by value
by Raymond Chen
From the article:
The versions of the std::equal function that takes a binary predicate accepts the predicate by value, which means that if you are using a functor, it will be copied, which may be unnecessary or unwanted.
In my case, the functor had a lot of state, and I didn’t want to copy it....