OpenImageIO/oiio — pull request #789 by lgritz (2014-01-20 18:43:48+00:00)
Title: array_ref helper class encapsulates an array and length without ownership

This is akin to string_ref, but generalized to arrays of any type and without the other string-related baggage. I don't use it anywhere yet, just submitting the template definition for feedback.

The idea is that (a) for functions with a parameter that's a const std::vector&, this would let us pass an array (or pointer + length) without the allocation and copying necessary to marshall the data into a std::vector, and (b) for functions that take a const T*, this allows a more explicit contract between caller and callee about the length of the array.