On Mon, 10 Oct 2016, Wouter van Ooijen wrote: > In your idea, as a user, can I be *sure* that a certain (complicated) > part is run by the compiler at compilation? > > In C++ 0x14 you can > > - declare any function as constexper, which means that the compiler must > check that it can evaluate that function at compile time (provided that > it knows the arguments at compile time). Such a function is still usable > at run time too. > > - declare any const value as constexpr, which means that the compiler > must evaluate it at compile time. > > There isn't much special about a constexpr function that isn't obvious > (like: it can't access globals, can't do memory allocation, etc.). Hi Wouter, The short answer is yes - if you declare a constant and use a function to=20 initalise it that does not depend on external unknowns. The longer answer is "it is not intended to be restricted that way". When=20 I explained how functions could be executed at compile time this was an=20 attempt to quickly focus the reader on an obvious benefit. The reallity=20 however is that compile time execution goes way beyond what I described.=20 It opens up a huge number of possibilites for deep analysis and=20 optimisation which I have not described. It is not just about executing=20 functions as a unit but about executing as much of the code as possible=20 without the function call acting as a barrier. What I would like to see users doing is writing code that describes the=20 process they need to achive and let the compiler worry about the=20 optimisation. This is an example of what I would like the user to be able to do: Standard(ish) C: header file: myblob.h struct MYBLOB { int X[MYBLOB_X_LEN]; char Y[MYBLOB_Y_LEN]; float Z[MYBLOB_Z_LEN]; }; MYBLOB blob; void init_blob(void) { for (int j=3D0; j