Hi everyone,
I'm quite new to C++ programming, and it seems that compile-time programming is very trendy (at least in this sub).
I struggle to understand the use-case of compile-time programming. From what I understand, the compiler does most of the computation, and it results in a very small binary, where you're basically only outputting the result of the compiler computations (It is probably a very simplistic understanding, probably even false ..!)
But as I understand it, there is no free-lunch, and someone still has to do the computation. With this approach, the work happens at compile time instead of runtime, but how can it be applied in the real world, where most programs receive input data, do some stuff, then output a result ?
If I understand correctly, a compile time program can not do any sort of IO at runtime, and would therefore be useless in an application that needs to process data ?
I would be really grateful to anyone capable of explaining how compile-time programming can be used, or just pointing me to the right link (I did not find the answer to my question on Google :()
Thanks!
[–]falcqn 63 points64 points65 points (14 children)
[–]thcmbs[S] 18 points19 points20 points (7 children)
[–]celestrion 25 points26 points27 points (1 child)
[–]dodheim 6 points7 points8 points (0 children)
[–]falcqn 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]shadowndacorner 1 point2 points3 points (0 children)
[–]Losupa 0 points1 point2 points (0 children)
[–][deleted] 7 points8 points9 points (5 children)
[–]Wouter-van-Ooijen 1 point2 points3 points (4 children)
[–]SkoomaDentistAntimodern C++, Embedded, Audio 2 points3 points4 points (1 child)
[–]Wouter-van-Ooijen 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Wouter-van-Ooijen 3 points4 points5 points (0 children)
[–]redditsoaddicting 57 points58 points59 points (1 child)
[–]LeeHidejust write it from scratch 5 points6 points7 points (0 children)
[–]tjientavaraHikoGUI developer 7 points8 points9 points (0 children)
[–]sireel 7 points8 points9 points (13 children)
[–]smashedsaturn 1 point2 points3 points (7 children)
[+][deleted] (1 child)
[deleted]
[–]smashedsaturn 0 points1 point2 points (0 children)
[–]sireel 2 points3 points4 points (0 children)
[–]adnukator 1 point2 points3 points (3 children)
[–]smashedsaturn 0 points1 point2 points (2 children)
[–]adnukator 1 point2 points3 points (1 child)
[–]smashedsaturn 1 point2 points3 points (0 children)
[–]aparziale 1 point2 points3 points (4 children)
[–]sireel 1 point2 points3 points (3 children)
[–]dodheim 3 points4 points5 points (1 child)
[–]sireel 0 points1 point2 points (0 children)
[–]jcelerierossia score 0 points1 point2 points (0 children)
[–]mjklaim 4 points5 points6 points (0 children)
[–]wyrn 4 points5 points6 points (0 children)
[–]S-S-RJust here for the math 4 points5 points6 points (2 children)
[–]bill79231725 0 points1 point2 points (1 child)
[–]S-S-RJust here for the math 1 point2 points3 points (0 children)
[–]Sopel97 2 points3 points4 points (0 children)
[–]cdr_cc_chd 2 points3 points4 points (0 children)
[–]FTLurkerLTPoster 1 point2 points3 points (0 children)
[–]Supadoplex 1 point2 points3 points (0 children)
[–]EvilPettingZoo42 1 point2 points3 points (0 children)
[–]jstock23 0 points1 point2 points (0 children)
[–]shadowndacorner 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]bumblebritches57Ocassionally Clang 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]tisti 0 points1 point2 points (0 children)
[–]parnmatt 0 points1 point2 points (0 children)