Background: I am attached to arm-arago-linux-gnueabi-g++ (GCC) 4.3.3 . Although answers requiring C ++ 11 or later are also welcome, please expressly express any language requirement later than C ++ 03.
The object constructor fills in the values ββin the tables that will be used by the algorithm.
Since this table does not change and should not change, I want them to be const, how to do this?
Complexity # 1, values ββare generated using calculations, and I donβt want to hardcode them in the source file.
Complexity No. 2, the calculation sometimes depends on the inputs, which are available only at runtime.
Difficulty No. 3, I donβt know why, but I donβt want the array to be static, although the values ββcan be the same for all objects (cases when the values ββare independent of the runtime input).
Complexity # 4 is an array, so the list of initializers in C ++ 03 will not work.
Edit1: A few weeks after this post, I found that std :: array and std :: vector are a very good alternative to the C-style array when std :: array is not available.
source share