Lambda Function question?

how would I if possible

Take this function
1
2
3
4
5
6
7
8
9
10
11
12
13
void stringIsAnum(string &x, string prompt) { while (!is_digits(x = getInput(prompt))); }

// calling this code 

string getInput(string prompt) {

    string x;

    cout << prompt << endl;
    cin >> x;
    return x;
}



to add the below as a Lambda to the first function?
 
cerr << "Digits only please"<< endl; 





post your program with general/ normal function call. I show you Lambda conversion.
Topic archived. No new replies allowed.