我要运行的功能:
struct foo;
void bar(const foo* p = 0);
我如何调用函数:
auto thread = std::thread(&bar, NULL);
警告:
foobar.h:223:9:警告:将 NULL 传递给 'std::thread::thread(_Callable&&, _Args&& ...) 的非指针参数 2 [with _Callable = void (*)(const foo*), _Args = {int}]' [-Wconversion-null]
我在这里想念什么?
当我用非NULL
参数调用函数时,警告消失了。