array
array copied to clipboard
Annotate types with ABSL attributes?
Abseil has "portable" (ifdefed around clang) attributes for annotating:
-
ABSL_ATTRIBUTE_VIEW that something is a view (e.g.,
array_ref) -
ABSL_ATTRIBUTE_OWNER that something is owns all the data (e.g.,
array) - ABSL_ATTRIBUTE_LIFETIME_BOUND that a parameter passed into a free or member function needs to outlive the function.
Any objection to adding these in guarded behind some ifdefs of our own?
Good idea. Every couple of weeks, we see a new bug that looked like view_type view = MakeArray(). (to be fair, the same happens for std::string_views).