在C ++中进行调试的有用打印内容是
std::cout << __LINE__ << std::endl;
Run Code Online (Sandbox Code Playgroud)
当然,您可以简单地打印带有行号的字符串,例如:
std::cout << "this is line 54" << std::endl;
Run Code Online (Sandbox Code Playgroud)
但是当您四处移动时,它不会一直更改行号。Python中是否有任何等效的宏?
使用以下函数在查询中搜索匹配项,如果未找到匹配项则返回 NaN:
int64_t Foo::search(const std::string& foo, int64_t t0, ...
if {
...
}
else
return std::numeric_limits<int64_t>::quiet_NaN();
}
Run Code Online (Sandbox Code Playgroud)