Problem:
- Magic numbers are used to determine sizes, but are error prone.
Solution:
- Change
OUTPUT_SIZEto beconstexprso that it can be used in array sizes. - Use arrays so the size is carried with the variable instead of external computation.
- Cleanup initialization and further setting of
rkeywhich can now be simplified because it is astd::arrayinstead of a C-array.