I'm fairly new to C and C++. For practice I created Vector structs (Vector2 & Vector3). Now I want one to be dynamically casted to the other.
struct A {
operator B() const { return B(); }
}
struct B {
}
works just fine, but as soon as I add
operator A() const { return A(); }
to struct B
it throws all kinds of errors.
I tried Header Files, etc.
Is there a solution that allows this ↓ ?
int main() {
A a = B();
B b = A();
}