3 ms·
Not sure what you're trying to do, but: class A; class B; // 'forward declaration' if you want to google class A { unique_ptr<B> b; }; class B { un
by humanrebar 10y ago
Not sure what you're trying to do, but:
class A; class B; // 'forward declaration' if you want to google
class A { unique_ptr<B> b; };
class B { unique_ptr<A> a; };
...generally classes instantiating each other is a sign that your design needs rearranged, but it has its uses when writing graph types.