On 28 January 2012 20:39, Walter Bright <newshound2@digitalmars.com> wrote:
On 1/28/2012 6:50 AM, Manu wrote:
I'd certainly like to be able to mark these functions CTFE to be sure no runtime
code will ever be generated for them, and also, what can I do about CTFE
imports? I don't want that import in my binary...

Being in your object file doesn't mean they make it into the binary. Optlink, for example, will remove unreferenced COMDATs.

I still don't want it polluting my lib, and I also don't want the possibility that someone COULD link to it. It's simply not runtime code.
Additionally, while the code is still present in my lib, so must be the import that it makes use of...

I'd also like an error if the function were called outside of CTFE... so the CTFE attribute others have discussed seems like a good idea to me.