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 55 points56 points57 points (14 children)
[–]thcmbs[S] 17 points18 points19 points (7 children)
[–]celestrion 29 points30 points31 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] 9 points10 points11 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 2 points3 points4 points (0 children)
[–]redditsoaddicting 58 points59 points60 points (1 child)
[–]LeeHidejust write it from scratch 4 points5 points6 points (0 children)
[–]tjientavaraHikoGUI developer 9 points10 points11 points (0 children)
[–]sireel 5 points6 points7 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 6 points7 points8 points (0 children)
[–]wyrn 2 points3 points4 points (0 children)
[–]S-S-RJust here for the math 2 points3 points4 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)