lar::ProviderPack should accept objects of classes derived from the required ones
lar::ProviderPack (larcorealg:source:larcorealg/CoreUtils/ProviderPack.h) is a tuple containing instances of service providers, one for each type in
lar::ProviderPack template argument list. All of them must be provided, or a compilation error will ensue.
The current version requires the provider objects to be of the exact required type, which for example makes it impossible to initialise a pack requiring
detinfo::LArProperties (provider interface class) with a
detinfo::LArPropertiesStandard instance. While this can be worked around with a static cast, it would be better not to require such a cast.
The relevant check code is at larcorealg:source:larcorealg/CoreUtils/ProviderPack.h#L381 , where possibly
std::is_same should be replaced by
#1 Updated by Gianluca Petrillo almost 3 years ago
- Status changed from Assigned to Resolved
- % Done changed from 0 to 100
It was less trivial than I hoped... or I may have made the solution unnecessarily complex.
Either way, it is pushed in
develop branch of
larcorealg and it will be automatically part of the next LArSoft release (the one after v06_74_00).