是否可以声明一个变量extern constexpr并在另一个文件中定义它?
extern constexpr
我试了但是编译器给出了错误:
constexpr变量' i'的声明不是定义
constexpr
i
在.h:
extern constexpr int i;
在.cpp中:
constexpr int i = 10;
c++ extern constexpr
c++ ×1
constexpr ×1
extern ×1