??C++??????
???????????? ???????[ 2015/3/31 13:56:42 ] ????????C++ ??? ???????
???????????????????
????????????????£????????????????????????????????????á?????????У????????????????????????????????????????á?
??????????????????£??????????????????????????????????????????????????????????????????????????????????á????磺
????void print(const Bear&);
????void print(const Endangered&);
???????Panda???????print???????????????????
????1??????????????????????
??????????????????????????????????????ж??壨???У????????????????????????????????????????????????????????Щ???????????????????????????????????????????????????????????磺
class ZooAnimal
{
public:
virtual void print(){}
virtual ~ZooAnimal(){}
};
class Bear : public ZooAnimal
{
public:
virtual void print()
{
cout << "I am Bear" << endl;
}
virtual void toes(){}
};
class Endangered
{
public:
virtual void print(){}
virtual void highlight()
{
cout << "I am Endangered.highlight" << endl;
}
virtual ~Endangered(){}
};
class Panda : public Bear?? public Endangered
{
public:
virtual void print()
{
cout << "I am Panda" << endl;
}
virtual void highlight()
{
cout << "I am Panda.highlight" << endl;
}
virtual void toes(){}
virtual void cuddle(){}
virtual ~Panda()
{
cout << "Goodby Panda" << endl;
}
};
???????????μ??÷??????
int main()
{
Bear *pb = new Panda();
pb->print(); //ok: Panda::print
// pb->cuddle(); //error: not part of Bear interface
// pb->highlight(); //error: not part of Bear interface
delete pb; //Panda::~Panda
Endangered *pe = new Panda();
pe->print(); //ok: Panda::print
// pe->toes(); //error: not part of Endangered interface
// pe->cuddle(); //error: not part of Endangered interface
pe->highlight(); //ok: Panda::highlight
delete pe; //Panda::~Panda
return 0;
}
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????