My code basically:
class myclass : public singleton<myclass> {
public:
myclass();
private:
const float myfloat = 6000.0f;
const int sz_arr = (int)myfloat;
int arr[sz_arr]; // compiler complains about this line
};
Need to create arr at compile-time. Size of arr is known at compile-time! Ought to be computed based on myfloat value. How to achieve it? Also, myclass is singleton, only one instance of it is ever going to be created.