
On Sat, Nov 17, 2012 at 3:55 PM, Jeffrey Lee Hellrung, Jr. <jeffrey.hellrung@gmail.com> wrote:
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)?
Maybe nothing. Currently this doesn't work though: std::vector<int> a; boost::iterator_range<int*> b = a;
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[]?).
Yes, it does have operator[], my bad. data() is frequently used to pass the range to a C-style function. -- Olaf