Consider
#include <string>
#include <iostream>
int main()
{
std::string test="αλφα";
std::cout << "size() of '" << test << "' = " << test.size() << std::endl;
}
which produces
size() of 'αλφα' = 8
How can I with the C++ standard library find the width of the output that will be produced by writing a string (i.e. 4 in the example above)?