コード例 #1
0
	public: virtual void insertQuarter() {
		std::cout << "You inserted a quarter" << std::endl;
		gumballMachine->setState(gumballMachine->getHasQuarterState());
	}
コード例 #2
0
 void insertQuarter() const {
     std::cout << "You inserted a quarter" << std::endl;
     _gumballMachine->setState(_gumballMachine->getHasQuarterState());
 }