-
- Downloads
Add R__SUGGEST_ALTERNATIVE macro to flag legacy functions
Functions that are outdated, but will not be removed, can be flagged with `R__SUGGEST_ALTERNATIVE`, a macro expanding to ROOT's `_R__DEPRECATED_LATER`. This can be used to point users to the recommended interfaces. Flagging a function like this: TIterator* createIterator() const R__SUGGEST_ALTERNATIVE("begin(), end() and range-based for loops are faster.") { ... } and defining `R__SUGGEST_NEW_INTERFACE` in a translation unit will trigger a warning such as: RooChebychev.cxx:66:34: warning: 'createIterator' is deprecated: There is a superior alternative: begin(), end() and range-based for loops are faster. [-Wdeprecated-declarations] TIterator* coefIter = coefList.createIterator(); IMPORTANT: Theoretically, the macro could be used for classes: Don't! This will trigger warnings for all uses of the class in the interfaces of ROOT.
Please register or sign in to comment