As you know, you can't write such code in C++:
struct Test
{
Test _this;
};
But this is quite possible
struct Test
{
Test* _this;
};
That's when I got this error while writing the following code
error: 'std::pair<_T1, _T2>::second' has incomplete type
_T2 second
struct Test
{
std::unordered_map<int, Test> dictionary;
};
I thought that the msvc implementation of std::pair
uses pointers for storage.
It's true? If not, what is the difference between the implementations and what is the reason for this?