寻求带有某种特征的 C++项目

2020-12-10 20:34:36 +08:00
 linux40

这种特征如下:

代码实例如下:

struct Base {
    virtual void foo();
};

struct Derived0 : Base {
    virtual void foo() { /* do something */ }
};

struct Derived1 : Base {
    virtual void foo() { throw std::exception{ "Not Implemented!" }; }
};

void bar(Base &base)
{
    /* do something */
    base.foo();
}

void baz()
{
    Derived0 d0;
    bar(d0);
    /* do something */
}
1171 次点击
所在节点    C++
4 条回复
linux40
2020-12-10 21:51:52 +08:00
对了,还有一点要求,Derived0::foo 不能抛异常,比如没有 new 之类的。
linux40
2020-12-11 19:35:06 +08:00
kuso,人工顶一下。。。
secondwtq
2020-12-12 00:05:27 +08:00
我倒是觉得这个主题符合这种特征: https://en.wikipedia.org/wiki/XY_problem
linux40
2020-12-12 02:11:23 +08:00
@secondwtq 这可能是一种线索。有实际的开源项目例子就好了。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/734272

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX