So I am having trouble with the way classes are being used in std::variant.
Say I have the folowing code:
// abc.h
#include <variant>
class A
{
public:
A(std::variant<B, C> data);
};
class B
{
public:
B(std::variant<A, C> data);
};
class C
{
public:
A(std::variant<A, B> data);
};
It would give me errors like error C2065: 'NameOfClass': undeclared identifier when I try to use classes that haven't been declared yet. What would be a good solution for this? In my actual project there are quite a number of classes that use each other in variants.