Ie, is there any difference between
subrange(V, 0, 3);
and
project(V, range(0,3));
?
I ask because I’m digging into some code that seems to use both forms (with no apparent rhyme/reason for one vs. the other), but I can’t see any difference between the two… just wanted to check to make sure I’m not missing something.
Looked into it, and I’ve confirmed there is no difference – subrange is simply an easy wrapper for a common-case of project, and in these cases:
…they end up identical. So using either should be fine, as long as you’re consistent!
For the more curious… subrange does:
while project does:
..and since vector_range::range_type is defined to be
…ie, exactly what is used in subrange, the two forms are identical.