VS 2012 intellisense-函数可能未初始化
VS 2012 intellisense - function may not be initialized
我只是在玩decltype,注意到VS 2012中的intellisense给了我一个错误。这是我第一次遇到这种情况,代码仍在编译中。
#include <iostream>
int func(int param)
{
std::cout << "IM BEING CALLED: " << param << std::endl;
return 0;
}
int main()
{
auto& y = func;
auto z = func;
decltype((func))& x = func;
decltype((func)) k = func; // function 'k' may not be initialized but compiles
func(9);
x(10);
y(11);
z(12);
k(13);
std::cout << std::endl;
std::cout << "Address of func: " << func << std::endl;
std::cout << "Address of x: " << x << std::endl;
std::cout << "Address of y: " << y << std::endl;
std::cout << "Address of z: " << z << std::endl;
std::cout << "Address of k: " << k << std::endl;
std::cin.get();
return 0;
}
这对大多数人来说既不是一个大问题,也不是一个有趣的问题,但我只是想知道是否有人知道错误背后的原因?
我只是想知道是否有人知道错误背后的原因
这只是一个解析错误。没有更多,没有更少。
相关文章:
- 正在初始化函数指针的constexpr数组
- 我应该在C++中使用构造函数还是初始化函数
- 使用 extern const 初始化函数
- 初始化函数中的静态变量,而不是在文件开始时
- 如何初始化函数中指针数组的大小
- 正在初始化初始化函数中的静态类成员
- call_once初始化函数
- SWIG + CMAKE:缺少初始化函数
- 如何创建在 c++ 中只读取一次的初始化函数
- 类内的强制初始化函数
- 使用元编程在编译时初始化函数数组
- 数组初始化函数:将数组作为指针传递:C++
- 从nodejs模块初始化函数报告失败
- 导入错误:动态模块未定义初始化函数
- 大括号初始化函数指针数组:从 'void (*(*)())()' 到 'void (*)()' 的转换无效
- 奇怪的行为,用 int 初始化函数指针
- 使用 init_seg 调用初始化函数
- 正在初始化函数内部的std::数组
- 初始化函数内部的指针.它是如何工作的
- JNI初始化函数以及缓存类和字段