Engineering A Sort Function In Cpp