Comment faire pour std :: string indexof en C ++ qui retourne l'index de la chaîne correspondante?

Je suis à la recherche d'une chaîne indexof fonction de l'espace de noms std qui renvoie un entier en une chaîne correspondante similaire à java en fonction du même nom. Quelque chose comme:

std::string word = "bob";
int matchIndex = getAString().indexOf( word );

où getAString() est définie comme ceci:

std::string getAString() { ... }

source d'informationauteur Alex B