I'm trying to write a layer for making some components of a project more modular. How can I make a class Foo exactly equal to a class Bar, where Foo would be able to be used as the variable 'a' in a function int testFunc(Bar a)
?
Would the only solution be to have Foo have a definition like this?
class Foo {
public:
Foo(int a) : barReturn(a) {};
operator Bar() const { return barReturn; }
private:
Bar barReturn;
};