How to "expose on spawn" a constructor param in C++?

It seems like a messy workaround, isn’t there a better and straighter way for achieving that?