Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Make it clear where the reference_wrapper is coming from, since it doesn't show up in the program's source

...

Compliant Solution (std::reference_wrapper)

This compliant solution wraps uses std::ref to wrap the predicate in a std::reference_wrapper<T> object, ensuring that copies of the wrapper object all refer to the same underlying predicate object.

...