Present array dimensions as a numerical sequence.
More...
|
namespace | exercise_5_6 |
| Encapsulate solution for Exercise 5-6.
|
|
Present array dimensions as a numerical sequence.
5-6. Write a sequence adapter template called dimensions that, when
instantiated on an array type, presents the array's dimensions as a
forward, non-extensible sequence:
typedef dimensions<char [10][5][2]> seq;
BOOST_STATIC_ASSERT( mpl::size<seq>::value == 3 );
BOOST_STATIC_ASSERT(( mpl::at_c<seq,0>::type::value == 2 ));
BOOST_STATIC_ASSERT(( mpl::at_c<seq,1>::type::value == 5 ));
BOOST_STATIC_ASSERT(( mpl::at_c<seq,2>::type::value == 10 ));
Consider using the type traits library facilities to simplify the
implementation.
◆ test_exercise_5_6()
static void anonymous_namespace{chapter-5.cpp}::test_exercise_5_6 |
( |
| ) |
|
|
static |