For ord he could use std::to_string
string ord(string const &s) {
return to_string(unsigned(s[0]));
}
He skips all the const-refs...