加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – 使用gcc的boost :: variant链接器错误

发布时间:2020-12-16 07:31:18 所属栏目:百科 来源:网络整理
导读:我想弄清楚以下为什么不能编译,我有点疯狂: #include iostream#include array#include boost/variant.hpp#include forward_listtypedef unsigned long long very_long;typedef boost::variant int,std::string variants_type;typedef std::array variants_t
我想弄清楚以下为什么不能编译,我有点疯狂:

#include <iostream>
#include <array>
#include <boost/variant.hpp>
#include <forward_list>

typedef unsigned long long very_long;
typedef boost::variant< int,std::string > variants_type;
typedef std::array< variants_type,5 > row_type;
typedef std::forward_list<row_type> rows_holder_type;

int main() {

    rows_holder_type rows;
    row_type row_data;

    row_data[0] = 0;
    row_data[1] = 0;
    row_data[2] = 0;
    row_data[3] = 0;
    row_data[4] = 0;

    rows.push_front(row_data);
}

这是我得到的编译器错误:

/usr/include/testing/test_code.o||In function 'std::array<boost::variant<int,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,boost::detail::variant::void_,boost::detail::variant::void_>,5ul>::array(std::array<boost::variant<int,5ul> const&)'

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读