"FOR" in preprocessor macro

  • Thread starter Thread starter songie D
  • Start date Start date
S

songie D

would it be possible to sort of engineer some sort of preprocessor macro
that does a 'for' loop.
i.e. for where you would normally use a normal for loop, but when it is
known ay compile time whay the variable is, hence unrolling the loop.
 
Sven said:
Doesn't VC already do this with a normal for-loop when optimising for
speed, the number of iterations can be determined at compile time,
and the amount of inserted code is reasonable small?

I'm certain I've come across a compiler that did that, but I can't
remember for certain if VC does it though...

I'm not sure if VC does automatic loop unrolling, but there definitely are
compilers that do so.

-cd
 
Back
Top