Is there a technical reason to use > (<) instead of != when incrementing by 1 in a 'for' loop?

后端 未结 21 2105
小蘑菇
小蘑菇 2020-12-23 19:48

I almost never see a for loop like this:

for (int i = 0; 5 != i; ++i)
{}

Is there a technical reason to use >

21条回答
  •  北荒
    北荒 (楼主)
    2020-12-23 20:50

    Yes; OpenMP doesn't parallelize loops with the != condition.

提交回复
热议问题