Mar. 17th, 2011 [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Thu 2011-03-17 10:23
C abuse of the week

A while back I wanted to write some C code that looped over every element in a collection. But I wanted the code to be parametrisable in the face of different implementations of that collection, because it might have to link against several other pieces of code which might all store the things in question in a different format.

iteration over a collection of elephants by C switch abuse )

eta: there's a bug in the switch-based solution above. See my follow-up post for details.

[xpost |http://simont.livejournal.com/231422.html]

Link23 comments | Reply
navigation
[ viewing | March 17th, 2011 ]
[ go | Previous Day|Next Day ]