www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Limitations in CTFE?

reply Robert Fraser <fraserofthenight gmail.com> writes:
I'm sure this has been discussed numerous times before, but I couldn't find it
in the first ten pages of a newsgroup search, so here goes:

What are the requirements for a function to be executed at compile-time? I
understand...

* no heap allocation/object instantiation
* no casting
* no side effects
* no shared memory access/state beyond the scope of the function
* no synchronization/multithreading
* no pointer/reference usage
* no out/ref parmeters

Am I right about this? Anthing else?
Jun 01 2007
parent reply Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
Robert Fraser wrote:
 I'm sure this has been discussed numerous times before, but I couldn't find it
in the first ten pages of a newsgroup search, so here goes:
 
 What are the requirements for a function to be executed at compile-time?
 

Try the documentation, too: http://www.digitalmars.com/d/function.html -- Remove ".doesnotlike.spam" from the mail address.
Jun 01 2007
parent Robert Fraser <fraserofthenight gmail.com> writes:
Heh; sorry; should've checked there again. I read that a long time ago and
didn't think that it might have changed. Thanks!

Deewiant Wrote:

 Robert Fraser wrote:
 I'm sure this has been discussed numerous times before, but I couldn't find it
in the first ten pages of a newsgroup search, so here goes:
 
 What are the requirements for a function to be executed at compile-time?
 

Try the documentation, too: http://www.digitalmars.com/d/function.html -- Remove ".doesnotlike.spam" from the mail address.

Jun 01 2007