I have a variadic template factory function that accepts an unknown number of arguments. This is supposed to call a private constructor, but I don't know how to connect the factory to the actor.
Something like this is what I have:
class X : public std::enable_shared_from_this<X> {
int i;
double d;
public:
template<typename...Ts>
static std::shared_ptr<X> create( Ts&&...params) {
/// HERE!! how do I code this???
/// Assume I have to keep this factory's signature
}
private:
// constructor is private:
X(int x, double y) : i{x}, d{y} {}