Rantzilla

George Demmy advancing the State of the Fine Art of Ranting

11 May 2007

Duff's Template


template <class T>
void
duff(T* to, T* from, T count) {
T n = (count+7)/8;
switch (count % 8) {
do {
case 0: *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
} while (--n > 0);
}
}
Posted by g at 07:27 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

About Me

My photo
g
View my complete profile

Blog Archive

  • ►  2019 (29)
    • ►  May (8)
    • ►  April (15)
    • ►  March (6)
  • ►  2010 (2)
    • ►  May (1)
    • ►  April (1)
  • ►  2009 (7)
    • ►  September (2)
    • ►  July (1)
    • ►  June (1)
    • ►  May (2)
    • ►  February (1)
  • ►  2008 (5)
    • ►  July (1)
    • ►  April (4)
  • ▼  2007 (19)
    • ►  October (1)
    • ►  August (1)
    • ►  July (1)
    • ▼  May (1)
      • Duff's Template
    • ►  April (5)
    • ►  February (1)
    • ►  January (9)
  • ►  2006 (369)
    • ►  December (2)
    • ►  October (7)
    • ►  September (15)
    • ►  August (28)
    • ►  July (43)
    • ►  June (43)
    • ►  May (46)
    • ►  April (41)
    • ►  March (61)
    • ►  February (38)
    • ►  January (45)
  • ►  2005 (518)
    • ►  December (21)
    • ►  November (18)
    • ►  October (32)
    • ►  September (31)
    • ►  August (29)
    • ►  July (32)
    • ►  June (25)
    • ►  May (28)
    • ►  April (43)
    • ►  March (161)
    • ►  February (98)
Simple theme. Powered by Blogger.