Does c++11 offer elegant solution as implemented in python maketrans/translate?
from string import maketrans
intab = "aeiou"
outtab = "12345"
trantab = maketrans(intab, outtab)
str = "this is string example....wow!!!";
print str.translate(trantab);
As as I'm aware there's no built-in function for this, but you could conceivably implement one: