Page MenuHome

Blenlib: New ArrayRef data structure

Authored by Jacques Lucke (JacquesLucke) on Mon, Aug 26, 4:22 PM.



This is the first of potentially many c++ extensions to blenlib.

This patch implements two new very similar data structures:
ArrayRef and MutableArrayRef. Both have a typed pointer
and a length of the referenced array.

This is inspired by the llvm code base. While working with it,
I noticed that these data structures make C++ development much
more comfortable in many circumstances.

They can make code faster by eliminating unnecessary copies and
conversions. They also make code simpler by avoiding unnecessary
templated parameters to support different containers as inputs.

Diff Detail

rB Blender
blenlib-array-ref (branched from master)
Build Status
Buildable 4617
Build 4617: arc lint + arc unit

Event Timeline

I'm fine with this direction, but this needs approval from @Sergey Sharybin (sergey) and @Campbell Barton (campbellbarton) as well, if it's ok to start adding c++ code in this module.


save -> safe

This revision is now accepted and ready to land.Mon, Aug 26, 6:58 PM