[range] contiguous iterators

16 Mar
2013
16 Mar
'13
2:42 p.m.
Hi everyone,
is there any way to generically determine at compiletime whether an
iterator or a boost range refers to contiguous memory?
i.e. &*(it+1) == (&*it)+1
some type trait like
is_contiguous

19 Mar
19 Mar
12:08 a.m.
On Sat, Mar 16, 2013 at 10:42 AM, Stefan Strasser
Hi Stefan, I needed this functionality for Boost.Compute in order to determine if a region of memory could be copied directly to the GPU or if an intermediate std::vector was required. It works just like your example except I used the name is_contiguous_iterator instead. The implementation is here: https://github.com/kylelutz/compute/blob/master/include/boost/compute/detail... Cheers, Kyle
4431
Age (days ago)
4434
Last active (days ago)
2 comments
3 participants
participants (3)
-
Jeffrey Lee Hellrung, Jr.
-
Kyle Lutz
-
Stefan Strasser