how can i refactor this code, this kind of code structure really smells bad.
example code below:
class A {
public:
void init(){
// do something and init b
}
auto foo(auto p, auto q){
return b.foo(p, q);
}
auto bar(auto p, auto q){
// maybe do something here
return b.bar(p, q);
}
// all kinds of funcs like foo and bar
private:
B b;
}
is there any design pattern or best practice for this?
Aucun commentaire:
Enregistrer un commentaire