Why does this work
auto f = std::string();
f = "src.Id";
But this does not
std::string f();
f = "src.Id";
Why does this work
auto f = std::string();
f = "src.Id";
But this does not
std::string f();
f = "src.Id";
It's because
std::string f();
declares a function f
which takes no arguments and returns a string. It's often (but wrongly) called the most vexing parse.