经常我遇到像黑客一样的黑客
//lets say this is some class that still doesnt support...
//...all the functionality that it should based on the design docs
void MyClass::MyFunction()
{
throw std::exception("not implemented");
}
Run Code Online (Sandbox Code Playgroud)
我想这是一个不好的做法,但除此之外:
有没有办法在编译期间做同样的事情,但只有在使用函数时(如果它是未使用的编译应该成功).
编辑:我也对虚拟内存功能感兴趣.
如果完全删除实现并且只有函数声明,则会出现链接器错误,这基本上是编译时间.不幸的是,链接器错误有一种丑陋和难以追踪的倾向,但在调用尚未实现的功能的情况下,我认为它们非常易于管理.
| 归档时间: |
|
| 查看次数: |
4041 次 |
| 最近记录: |