
31 Jan
2012
31 Jan
'12
7:02 p.m.
On Tue, Jan 31, 2012 at 7:57 PM, Yakov Galka <ybungalobill@gmail.com> wrote:
b) Add *one* implicit constructor to array_ref:
template<class R> array_ref(const R& x, typename enable_if< is_base_of< contiguous_iterator_tag, typename iterator_traits< decltype(begin(x)) >::iterator_category >::value, int >::type = 0); // use &*begin(x), (end(x) - begin(x)) to initialize.
You should check whether the range is empty before dereferencing begin(). Olaf