Allow ParameterPack to be constructed from elements that are not default constructible
#855
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The docstrings state that
ParameterPackrequires the elements to be copyable to the device.When
makeParameterPackis used it implicitly requires default constructability and assignability of the elements. This would not be necessary ifParameterPackwould provide a ctor that allows to go through the element's copyctor.This PR adds a ctor to
ParameterPackthat uses the element's copy ctor.I am not sure if we want the ctor to be part of the public interface or make it private and have a new convenience function (like
makeParameterPack) that is friend of the class and can construct it.This came up in CabanaPD for multiforce models where we would like to have a model that redirects to a multitude of models that are stored in the
ParameterPack. Nevertheless, the models are not default constructible. An alternative to this PR would be to make the models in CabanaPD default constructible and assignable.