You want to make a new array, where each cell in A is added to the same cell in B. So you are going to do a loop over 2 variables, right?
in FORTRAN the code is...
C = A + B
in Julia the code is C = A .+ B
Fortran gets its performance from prohibition of aliasing, which is something that C++ admits as per the standard. One could enable the same performance boosts with a non standard compiler flag, but this breaks a lot of codebases, including the Linux kernel AFAIK.
Aliasing is a pox upon the world. There's a lot of work gone into stuff like UBSan for C++. I think aliasing should be added to stuff that it checks for. Dunno how much overhead that would be though.
But more generic array slicing with strides seems to get nasty in Eigen. For example if
v2 = v(1:2:20)
Map<RowVectorXf,0,InnerStride<2> > v2(v.data(), v.size()/2);
Different shape for array assignment at (1) on dimension 1