3
以下代碼crashes GCC並且無法使用Clang進行編譯。它出什麼問題了?繼承boost :: variant和templatized AST
#include <boost/variant.hpp>
#include <array>
#include <iostream>
template<class Node>
struct wrapper1;
template<class Node>
struct wrapper2;
struct ast_node;
using ast_node_base = boost::variant<boost::recursive_wrapper<wrapper1<ast_node>>, boost::recursive_wrapper<wrapper2<ast_node>>>;
struct ast_node : ast_node_base
{
using ast_node_base::ast_node_base;
};
template<class Node>
struct wrapper1
{
std::array<Node, 1> children;
};
template<class Node>
struct wrapper2
{
std::array<Node, 2> children;
};
int main()
{
ast_node node;
std::cout << "done\n";
}
鐺++ [喜歡它](http://coliru.stacked-crooked.com/a/26ff6c04b3597b01)太 – sehe