I've been pondering over this idea for a few weeks. What about
functions/methods that are built and ran at compile time. Admittedly
this sounds a bit like pre-processing, but it's not.
- One use for this would be to load resources such as bmp files
into the executable. ie
compile Picture loadBMP(char[] filename) {...} //This method will only
run at compile time
...
Picture something = loadBMP("mypicture.bmp"); //Picture class is build
and created at compile time, with the picture image inside.
Of course then you need compile time classes, and it may never end.
Parhaps only libraries could be compile time, or something like that.
- Another use would be for creating a static class registry.
- Yet another use would be for more advanced compile time checking
ie like an advanced static assert.
-Anderson
Should I send it no, yes, no...