template<class T>
class ROOT::Detail::TRangeStaticCast< T >
TRangeStaticCast is an adaptater class that allows the typed iteration through a TCollection.
This requires the collection to contains element of the type requested (or a derived class). Any deviation from this expectation will only be caught/reported by an assert in debug builds.
This is best used with a TClonesArray, for other cases prefered TRangeDynCast.
The typical use is: ~~~ {.cpp} for(auto bcl : TRangeStaticCast<TBaseClass>( <em>tbaseClassClonesArrayPtr )) { assert(bcl && bcl->IsA()->InheritsFrom(TBaseClass::Class())); ... use bcl as a TBaseClass } for(auto bcl : TRangeStaticCast<TBaseClass>( tbaseClassClonesArrayPtr )) { assert(bcl && bcl->IsA()->InheritsFrom(TBaseClass::Class())); ... use bcl as a TBaseClass* } ~~~ {.cpp}
Definition at line 382 of file TCollection.h.