#include <iostream>
#include <vector>
using namespace std;
class Tiles {
public:
void AddTile(int x) { tiles_.push_back(x); }
std::vector<int> tiles_;
};
class TilesWithData : public Tiles {
public:
void AddTile(int x, double data) {
tiles_.push_back(x);
data_.push_back(data);
}
std::vector<double> data_;
};
int main() {
Tiles a;
a.AddTile(10);
TilesWithData b;
b.AddTile(20, 12.5);
b.AddTile(30);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgVGlsZXMgewogcHVibGljOgogIHZvaWQgQWRkVGlsZShpbnQgeCkgeyB0aWxlc18ucHVzaF9iYWNrKHgpOyB9CiAgc3RkOjp2ZWN0b3I8aW50PiB0aWxlc187Cn07CgpjbGFzcyBUaWxlc1dpdGhEYXRhIDogcHVibGljIFRpbGVzIHsKIHB1YmxpYzoKICB2b2lkIEFkZFRpbGUoaW50IHgsIGRvdWJsZSBkYXRhKSB7IAogICAgdGlsZXNfLnB1c2hfYmFjayh4KTsKICAgIGRhdGFfLnB1c2hfYmFjayhkYXRhKTsgIAogIH0KICBzdGQ6OnZlY3Rvcjxkb3VibGU+IGRhdGFfOwp9OwoKaW50IG1haW4oKSB7CglUaWxlcyBhOyAKCWEuQWRkVGlsZSgxMCk7IAoJCglUaWxlc1dpdGhEYXRhIGI7IAoJYi5BZGRUaWxlKDIwLCAxMi41KTsKCWIuQWRkVGlsZSgzMCk7CglyZXR1cm4gMDsKfQ==
prog.cpp: In function ‘int main()’:
prog.cpp:26:14: error: no matching function for call to ‘TilesWithData::AddTile(int)’
b.AddTile(30);
^
prog.cpp:13:8: note: candidate: void TilesWithData::AddTile(int, double)
void AddTile(int x, double data) {
^~~~~~~
prog.cpp:13:8: note: candidate expects 2 arguments, 1 provided