Why can't I inherit from int in C++?

前端 未结 19 2202
不知归路
不知归路 2020-12-02 18:24

I\'d love to be able to do this:

class myInt : public int
{

};

Why can\'t I?

Why would I want to? Stronger typing. For example, I

19条回答
提交回复
热议问题