Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2004

Tip: Looking for answers? Try searching our database.

"FOR" in preprocessor macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
songie D - 11 May 2004 22:27 GMT
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.
Carl Daniel [VC++ MVP] - 11 May 2004 23:34 GMT
> 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.

http://www.boost.org/libs/preprocessor/doc/index.html

-cd
Sven Groot - 11 May 2004 23:43 GMT
>> would it be possible to sort of engineer some sort of preprocessor
>> macro that does a 'for' loop.
[quoted text clipped - 3 lines]
>
> http://www.boost.org/libs/preprocessor/doc/index.html

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

Signature

Sven Groot

http://unforgiven.bloghorn.com

Carl Daniel [VC++ MVP] - 11 May 2004 23:46 GMT
>>> would it be possible to sort of engineer some sort of preprocessor
>>> macro that does a 'for' loop.
[quoted text clipped - 10 lines]
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.