Queue implementation in Cpp