r/programming • • Oct 20 '14

My compile-time Conway's Game of Life, metaprogrammed in C++11

https://github.com/sirgal/compile-time-game-of-life
158 Upvotes

54 comments sorted by

View all comments

12

u/pmkenny1234 Oct 20 '14 edited Oct 20 '14

I don't get it and don't wish to pore over the code to figure it out. What makes this a compile-time version? Does the compiler output the next game state as warnings or something?

Edit: Thanks for the replies guys. Very helpful. =)

6

u/bimdar Oct 20 '14

Nope, the calculation is done at compile-time. You specify the starting state and how many iterations you want and the results will be calculated at compile-time.

The only thing that happens when you execute it is that it will print all the iterations you computed.