[cfe-dev] Introducing attribute objc_pure_virtual_method
Ted Kremenek
kremenek at apple.com
Wed Oct 30 12:54:54 PDT 2013
On Oct 30, 2013, at 7:24 AM, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote:
> It would be cleaner, from a documentation standpoint, to be able to mark a protocol that a class implemented as requiring reimplementation in all subclasses. Then it could be something that was both obvious in the documentation and checkable in the compiler.
Right. This follows on my comment about protocols in my previous email:
> varadictemplate: Do you see a compelling need for this that cannot be modeled using protocols? The class adopting the protocol is saying “all methods are implemented” for that protocol, which is natural way to express not only that a particular method is implemented, but that a group of methods are implemented.
I think my reasoning was a bit imprecise here. The base class likely wants to adopt the protocol as well, but force the protocol to be implemented by subclasses. This seems like a more general mechanism than just annotating individual methods.
variadictemplate: what do you think?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131030/19d654a0/attachment.html>
More information about the cfe-dev
mailing list