This little collection of snippets can be used in C/C++ projects to help document - in code - the ownership, lifetime, and consumption of arguments (both in signatures and invocation expressions).
The header provided is a set of simple #define
statements, allowing the documentation to run.
NOTE: This does impose the limitation that the identifiers
uses
,owns
, andconsumes
will no longer work in your code!
The provided vim-script can be used for helping discern these keywords in code. You'll want to tweak the color values.
This is a documentation "hack", and while it seems that it will cause readability headaches, the benefits of knowing just what code is doing with your pointer is beyond helpful.
Released into the public domain by Josh Junon (Qix-). Do what you want with it.