A function that doesn't use any private member should be defined as
a non-member function, so that it is obvious that it uses only public
interfaces of a given object.
Details
Details
Diff Detail
Diff Detail
- Repository
- rLLD LLVM Linker
Event Timeline
Comment Actions
I'm not sure I agree with the premis in the change description. There are plenty of times when a method makes sense even though it operates on only the public members (if only to take advantage of the implicit this and to keep data and logic grouped together). For example most of the methods in elf::Symbol only use public fields.
However I do like the re-write of this code. Would you consider re-writing but keeping it as method (using isa..(this) instead)?