Dave's Brain

Browse - programming tips - duffs device

Date: 2008apr2
Language: C/C++

Q.  What's the most far-out C programming thing?

A.  Quite possibly Duff's Device.

It's mind boggling.  It works and is perhaps actually useful
in some limited situations.

http://en.wikipedia.org/wiki/Duffs_device

This was invented in 1984, now-a-days I would just ask the compiler
to optimize (eg -O3 option to gcc).

Add a comment

Sign in to add a comment
Copyright © 2008, dave - Code on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License.