Хочу вот так:
class IGraph {
public:
virtual void foo(/*some magic to support variable amount of args in implementations*/) = 0;
};
class FirstGraph : public IGraph {
public:
void foo(int id) {/*some code*/}
};
class SecondGraph : public IGraph {
public:
void foo(int id, unsigned int weight) {/*some code*/}
};