For a class Foo, is there a way to disallow constructing it without giving it a name?
For example:
Foo(\"hi\");
And only allow it i
No, I'm afraid this isn't possible. But you could get the same effect by creating a macro.
#define FOO(x) Foo _foo(x)
With this in place, you can just write FOO(x) instead of Foo my_foo(x).