Код: Выделить всё
template
struct Node
{
T value;
std::vector kids;
boost::optional parent { boost::none };
}
template
struct Tree
{
std::vector heads;
};
Код: Выделить всё
...\boost\include\boost/optional/detail/optional_aligned_storage.hpp(31): error C2027: use of undefined type "Node"
Код: Выделить всё
boost::optional parent { boost::none };
Код: Выделить всё
boost::optional parent { boost::none };
Однако я, честно говоря, понятия не имею, почему именно.
Кто-нибудь может это объяснить?
Минимально воспроизводимо пример на godbolt: нажмите;
Подробнее здесь: https://stackoverflow.com/questions/786 ... type-error
Мобильная версия