小编Sir*_*bbs的帖子

How do I remove this inheritance-related code smell?

I need to implement a lot of derived classes with different const member data. The data processing should be handled in the base class, but I can't find an elegant way to access the derived data. The code below is working, but I really don't like it.

The code needs to run in a small embedded environment so extensive usage of the heap or fancy libraries like Boost is no option.

class Base
{
  public:
    struct SomeInfo
    {
        const char …
Run Code Online (Sandbox Code Playgroud)

c++ inheritance c++11

34
推荐指数
6
解决办法
6499
查看次数

标签 统计

c++ ×1

c++11 ×1

inheritance ×1