【C++ 小问答】3:未定义的 `Constexpr` 函数
问 下面哪些在编译期报错(非链接期):
1constexpr int GetVal(); 2constexpr int GetVal() { return 0; } 3constexpr int i = GetVal(); 1constexpr int GetVal(); 2constexpr int i = GetVal(); 1constexpr int GetVal(); 2int i = GetVal(); 1constexpr int GetVal(); 2constexpr int i = GetVal(); 3constexpr int GetVal() { return 0; } 答 将这几段代码分别用 g++ -c …