标签:
多重继承很容易带来的一个问题就是歧义的问题:
1 class BorrowAble{ 2 public: 3 void checkOut() const; 4 ... 5 }; 6 class ElectronicGadget{ 7 private: 8 bool checkOut()const; 9 ... 10 }; 11 class MP3Player: 12 public BorrowAbleItem, 13 public ElectronicGadget 14 {...}; 15 MP3Player mp; 16 mp.checkOut();
1 class File{...}; 2 class InputFile : virtual public File{...}; 3 class OutputFile : virtual public File{...}; 4 class IOFile : public InputFile, 5 public OutputFile 6 {...};
标签:
原文地址:http://www.cnblogs.com/-wang-cheng/p/4889798.html