standard algorithm implemenations in C++