使用提升精神解析的大型结构
Large structures parsed using boost-spirit
我可以编译此页面上的员工示例代码。
如果我用另外 8 个字符串扩展结构,如下所示:
struct employee
{
int age;
std::string surname;
std::string forename;
std::string a1;
std::string a2;
std::string a3;
std::string a4;
std::string a5;
std::string a6;
std::string a7;
std::string a8;
double salary;
};
(当然,我也扩展了BOOST_FUSION_ADAPT_STRUCT和语法),然后当我尝试编译时,我收到以下错误:
../include/boost/fusion/container/vector/convert.hpp:26:13: error: invalid use of incomplete type ‘struct boost::fusion::detail::as_vector<12>’
../include/boost/fusion/container/vector/detail/as_vector.hpp:26:12: error: declaration of ‘struct boost::fusion::detail::as_vector<12>’
我发现如果我的结构有 10 个项目>,就会发生这种情况。两个问题:
- 为什么会有这个限制?
- 我该如何解决它?
欢迎任何意见。
FUSION_MAX_VECTOR_SIZE
定义为您想要的任何上限,请查看boost/fusion/container/vector/limits.hpp
默认定义。 然后boost/fusion/container/vector.hpp
根据上限有条件地包括预处理的源。
相关文章:
- 在 lldb 中为大型数据结构设置观察点
- C++编译大型结构时内存使用过多
- 适用于频繁更改的大型数据集的最佳数据结构
- 在读取大型 txt 文件时动态分配结构内的向量
- 序列化没有"save"方法的大型结构
- 在C 功能执行后,使用GCHANDLE CRALSES将大型结构从C#Unity脚本传递到C DLL
- 为什么Protobuf对大型数据结构不利
- 将大型结构转换为小型C
- 高速缓存行检索和在大型数据结构上的性能
- 使用固定指针将大型数据结构传递给非托管代码
- std::string 或 char[] 作为大型数组状结构的元素
- 用于存储大型数据集的数据结构
- 如何在C++中编码大型复杂、恒定的数据结构
- 适合大型图形的数据结构
- 使用提升精神解析的大型结构
- 从大型文本文件读取到Qt中的结构数组中
- 如何处理大型指针结构
- C++在MPI进程之间共享大型数组和数据结构
- 在DOS 7.x中获取大型驱动器结构信息
- 在c++循环中,重用大型数据结构并重置内容或分配新的,这样更快