auto x = func(); printf("x is %s\n", x.c_str()); if(typeid(x) == typeid(string)) puts("x is string");