Hi, I just wanted to say, it's funny how I did the *EXACT* same thing only **a few days ago**: http://stackoverflow.com/questions/245584/d-templates-coolest-hack/4437847#4437847
Not counting the braces, the actual code is just 4 lines for the compile-time version, and 5 lines for the run-time version. The page above only has a link to one of these; both of the versions are here: http://ideone.com/q8lvf Pretty short, eh? I doubt that it can get any shorter than that code. :) Feel free to use my version inside the library. ("I hereby release the code to the public domain," to cover the legal stuff.)
