
On Sat, Nov 17, 2012 at 2:38 AM, Olaf van der Spek <ml@vdspek.org> wrote:
On Fri, Nov 16, 2012 at 10:20 PM, Jeffrey Lee Hellrung, Jr. <jeffrey.hellrung@gmail.com> wrote:
Actually, now that I think about it, contiguous_range<T> == iterator_range<T*>, AFAICT. Maybe iterator_range<T*> might want some member functions added for conversion to/from other contiguous ranges, and maybe there are some other interface tweaks one can make specific for pointers.
contiguous_range should have data() and operator[], iterator_range doesn't have them. iterator_range is also problematic when constructing from literals as literals are implicitly treated as arrays.
BTW, contiguous_range sounds like the array_ref proposal.
What would be the advantage of having a separate array_ref class over partially specializing iterator_range<T*> (preserving backward compatibility, of course)? I'm thinking now the latter might be sufficient, if indeed there is a different interface than the primary template (is data() that important? doesn't iterator_range already have operator[]?). - Jeff