SHARE
TWEET

lab8_modify

a guest Nov 14th, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. template <class ForwardIt, class Predicant>
  2. bool is_sorted_modify(ForwardIt first, ForwardIt last, Predicant pr)
  3. {
  4.     auto d = first;
  5.     auto i = d++;
  6.  
  7.     while (i != last)
  8.     {
  9.         if(!pr(*i, *d))
  10.         {
  11.             return false;
  12.         }
  13.         d = i;
  14.         i = i++;
  15.     }
  16.     return true;
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top