The boost tuple documentation says:
The current version supports tuples with 0-10 elements. If necessary, the upper limit can be increased up to, sa
Good news. Find the answer, it is just use the macro to re-define the max parameters. The library FUSION in boost re-define the tuple. Follow the following steps, you can easily extend the tuple parameters
include the fusion or TR1 version tuple header file instead of the normal tuple header
#define FUSION_MAX_VECTOR_SIZE 50
#include
To understand the above code better, you can refer to the header file "boost/tr1/tuple.hpp"
in the file, it has another "BOOST_TR1_USE_OLD_TUPLE" to refer to the old tuple implementation.
in the fusion's tuple implementation "boost/fusion/tuple/tuple.hpp", there is another macro. "BOOST_FUSION_DONT_USE_PREPROCESSED_FILES". if it is not defined, the library will use the pre-created header file, the maximum parameter are 50. if you need more, I believe you can just define this macro to true. From the code, it should be OK to have more parameters although I haven't really try it out. because 50 to me is far more enough ;)
find another issue if you just define FUSION_MAX_VECTOR_SIZE and you need the parameters are more than 50. you have to come out your own header file for the vector template instead of using the existing process header file. besides the following code, you also need define the macro "BOOST_FUSION_DONT_USE_PREPROCESSED_FILES" to exclude the proprocessed header file
#if (FUSION_MAX_VECTOR_SIZE > 50)
#include
namespace boost
{
namespace mpl
{
#define BOOST_PP_ITERATION_PARAMS_1 (3,(51, FUSION_MAX_VECTOR_SIZE, ))
#include BOOST_PP_ITERATE()
}
namespace fusion
{
struct vector_tag;
struct fusion_sequence_tag;
struct random_access_traversal_tag;
// expand vector51 to max
#define BOOST_PP_FILENAME_1
#define BOOST_PP_ITERATION_LIMITS (51, FUSION_MAX_VECTOR_SIZE)
#include BOOST_PP_ITERATE()
}
}