How can I make the following Boost Fusion struct?
#include <array>
#include <boost/fusion/include/define_struct_inline.hpp>
BOOST_FUSION_DEFINE_STRUCT_INLINE(
MyStruct,
(std::array<int, 3>, foo)
)
This fails to compile (GCC 4.8.1 and Boost 1.53) because std::array<int, 3>
is interpreted as 2 arguments instead of 1.
Note that I am NOT asking about the special case shown above (it's just an example). This particular problem has the trivial solution of just using typedef std::array<int, 3> Int3Array;
.
I am asking about the general problem of using types with multiple template arguments separated by commas as a type in the list of fields of a Boost Fusion struct. Eventually, I want to use a template Boost Fusion struct where I cannot define typedefs in advance. For example, I might want to do something like this:
BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE(
(A)(B)(C),
MyAdvancedStruct,
(A<B, C>, bar)
)