-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] AddBefore/After/At option variant, as with Add/First/Last v2 #18353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Test Results 15 files 15 suites 3d 21h 58m 33s ⏱️ Results for commit c3216c6. |
@@ -85,10 +85,15 @@ friend class TListIter; | |||
void AddLast(TObject *obj) override; | |||
virtual void AddLast(TObject *obj, Option_t *opt); | |||
void AddAt(TObject *obj, Int_t idx) override; | |||
virtual void AddAt(TObject *obj, Int_t idx, Option_t *opt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than declaration this virtual
we need to also update to TSeqCollection.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I was just copy pasting the structure from lines 85-86. AddLast overrides from TSeqCollection, AddLast with option is virtual. Otherwise it's not consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if we also moved AddLast and AddFirst to TSeqCollection to be consistent, that would break user-scripts deriving from that classes since they would become purely virtual (if one wants to keep consistent style).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if we made them non-purely-virtual, then users might start getting warnings such as warning: ‘virtual void ::AddAt(TObject*, Int_t, Option_t*)’ was hidden ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise it's not consistent?
Right. I missed that.
start getting warnings such as warning: ‘virtual void ::AddAt(TObject*, Int_t, Option_t*)’ was hidden ?
To extent that is better than use that:
- Inherits from TList
- Does not write/override
AddAt(TObject*, Int_t, Option_t*
- Somehow starts using it ...
- It would 'silently' fail (depending what the overload does - but for example it would/was the case for
THashList
)
This Pull request:
Changes or fixes:
Fixes https://its.cern.ch/jira/browse/ROOT-9288
New version addressing this comment from pcanal: #17846 (comment)
Checklist: