| 1 | #include <boost/type_traits.hpp>
|
|---|
| 2 | #include <boost/static_assert.hpp>
|
|---|
| 3 |
|
|---|
| 4 | using namespace boost;
|
|---|
| 5 |
|
|---|
| 6 | int main()
|
|---|
| 7 | {
|
|---|
| 8 | static const size_t TopDim = 2;
|
|---|
| 9 | static const size_t LowDim = 3;
|
|---|
| 10 |
|
|---|
| 11 | typedef int ArrayTwoDim[TopDim][LowDim];
|
|---|
| 12 | typedef int LowDimRemoved[TopDim];
|
|---|
| 13 | typedef int TopDimRemoved[LowDim];
|
|---|
| 14 |
|
|---|
| 15 | BOOST_STATIC_ASSERT((
|
|---|
| 16 | is_same<
|
|---|
| 17 | decay<ArrayTwoDim>::type,
|
|---|
| 18 | TopDimRemoved*
|
|---|
| 19 | >::value
|
|---|
| 20 | ));
|
|---|
| 21 |
|
|---|
| 22 | BOOST_STATIC_ASSERT((
|
|---|
| 23 | is_same<
|
|---|
| 24 | remove_extent<ArrayTwoDim>::type*,
|
|---|
| 25 | decay<ArrayTwoDim>::type
|
|---|
| 26 | >::value
|
|---|
| 27 | ));
|
|---|
| 28 |
|
|---|
| 29 | BOOST_STATIC_ASSERT((
|
|---|
| 30 | is_same<
|
|---|
| 31 | remove_extent<ArrayTwoDim>::type,
|
|---|
| 32 | TopDimRemoved
|
|---|
| 33 | >::value
|
|---|
| 34 | ));
|
|---|
| 35 |
|
|---|
| 36 | return 0;
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|