I can compile the employee example code found on this page.
If I extend the structure with 8 more strings like so:
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;
};
(And of course I extend the BOOST_FUSION_ADAPT_STRUCT and the grammar as well), then I get the following error, when I try to compile:
../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>’
I have found that this happens if my struct has > 10 items. Two questions:
- Why this limitation?
- How do I work around it?
Any input is welcome.
Define
FUSION_MAX_VECTOR_SIZEto whatever cap you want, take a look inboost/fusion/container/vector/limits.hppfor the default define.boost/fusion/container/vector.hppthen conditionally includes pre processed source depending on the cap.