I basically have the following situation:                         +------------------+                         |                  |                         |   Input object   |                         |                  |                      +--+------------------+--+unique_ptr<Subobject 1>                        |unique_ptr<base class of Subobject 2>                      |                        |                      |                        |                      |                        |                      |                        |             +--------v--------+     +---------v-------+             |                 |     |                 |             |   Subobject 1   |     |   Subobject 2   |             |                 |     |                 |             +-----------------+     +-----------------+I have a class that takes this input object, does some calculation, and outputs a new output object, that points in some places back to the original input object this I need separate input objects for every calculation. Now I would like to be able to queue multiple calculations with very similar input objects i.e. with Subobject 1 or 2 changed for a different object in order for a human to be able to compare results and find the best solution. As the objects are created based on XML input data, whenever I found a list of Subobjects instead of just one I wanted to just copy the top level object and swap only the values that needed to be swapped, but then I realized that unique_ptr prevents copying.I may have designed myself into a corner here, but is there any way to facilitate this method or am I stuck rebuilding the entire object manually for every permutation?
How can I copy and alter object with unique_ptr in it?
object oriented;c++;smart pointer;c++14