add Range constructors from std::array
authorAdam Simpkins <simpkins@fb.com>
Sat, 11 Feb 2017 01:11:44 +0000 (17:11 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 11 Feb 2017 01:20:48 +0000 (17:20 -0800)
commit60b6e844c5c581d9e8004e20a3409b6b4430fd9d
treea52629f16e356385af1687543904cc7d63553acb
parente1a26ff94eaf5dec7cd8c656815bcd426e559268
add Range constructors from std::array

Summary:
Add explicit constructors to create Range objects referring to the contents of
a std::array.

D4165608 previously added a folly::range() factory function to create Ranges
around const arrays.  However, it did not support non-const arrays.  However,
providing this as a constructor seems better.  This new constructor does not
appear ambiguous with any existing constructors, and a constructor allows for
more natural support of non-const arrays: the caller can explicitly indicate
if they want to construct a Range to const or non-const data in this case.

Reviewed By: yfeldblum

Differential Revision: D4523515

fbshipit-source-id: c1a262f9e8f76907d87d80b03f252576506e70ab
folly/Range.h
folly/test/RangeTest.cpp