std :: to_string - więcej niż instancja przeciążonej funkcji pasuje do listy argumentów

counter jestint

void SentryManager::add(std::string name,std::shared_ptr<Sentry>){
    name = name + std::to_string(counter);
}

Jaki byłby najlepszy sposób na zatrzymanie tego błędu? Kiedy byłem leniwy, właśnie zrobiłem intlong long (lub coś), ale jestem pewien, że jest lepszy sposób na rozwiązanie tego.

Komunikat o błędzie:

sentrymanager.cpp(8): error C2668: 'std::to_string' : ambiguous call to overloaded function

Korzystam z Visual C ++ 2010 Express.

questionAnswers(2)

yourAnswerToTheQuestion