I define a type called inputTy
using std::array
(c++11) , the dimension of the array declared as an external constant integer d
.
namespace project {
namespace types{
extern const int d;
typedef std::array<double, d> inputTy;
}
}
Why do I get such compilation error?
../../include/types.h:16:29: error: the value of ‘d’ is not usable in a constant expression
typedef std::array<double, d> inputTy;
^
../../include/types.h:15:18: note: ‘d’ was not initialized with a constant expression
extern const int d;
^
Thanks for your help.