The last two lines are what my question is about. I want to set sites->coord.x but have no clue how to do this. I get that siteptr site_ptr( new Site); is creating a shared pointer that points to the class Site but within new Site do i need to set the value of sites->coord.x = subx like this:

siteptr site_ptr( new Site(sites->coord.x = subx);

or maybe:

siteptr site_ptr( new Site(this->coord.x = subx);

As you can probably tell I'm really not sure. Or can I initialize the class and set the value later?