Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
2412 Discussions

Why does a range need a copy (instead of a move) constructor?

Walter_D_
Beginner
89 Views

TBB's range concept requires a copy constructor. Unfortunately, the reference manual does not specify why this is required, and algorithmically duplicating a range makes no/little sense. I can see that moving a range around between different parts of the algorithms may be necessary, but this can be achieved either by copying pointers or by using the move constructor. Are there plans to relax the concept to allow move-only constructible ranges (but still work with copy-constructible)? Or are there reasons (which) why this cannot be done?

0 Kudos
1 Reply
RafSchietekat
Black Belt
89 Views

A Range is just a pair of numbers/pointers/iterators: any referents are stored elsewhere.

Reply