Bogo sort algorithm implementation in Cpp