"FOR" in preprocessor macro

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.
 
C

Carl Daniel [VC++ MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top