solving c++ ambiguity