trying to replace the function from libstdc++

//#include<ext/algorithm> // this is not available in libc++ for use
with clang!