Tuples with more than 8 elements

ntuple<> can be used to create tuples of more than 8 elements. ntuple<> exposes two member class templates cat< P0, P1, P2, ... P7 > and cat_tuple< Tuple >.

ntuple< int, int, double, double, long, long, short, short >::cat< char, char >::type
  ten(
    ntuple_( 1, 2 ) << ntuple_( 3.4, 5.6 )
    << ntuple_( 7L, 8L ) << ntuple_( 9, 10 )
    << ntuple_( 'a', 'b' )
  )
;

std::cout << ten << std::endl;

Test Result: gcc34 Passed, msvc80 Passed, msvc71 Passed

Output

(1,2,3.4,5.6,7,8,9,10,a,b)
typedef ntuple< int, int > int2_t;
typedef int2_t::cat_tuple< int2_t >::type int4_t;

int4_t a( 1, 2, 3, 4 );

std::cout << a << std::endl;

Test Result: gcc34 Passed, msvc80 Passed, msvc71 Passed

Output

(1,2,3,4)