Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1 | // (C) Copyright John Maddock & Thorsten Ottosen 2005. |
| 2 | // Use, modification and distribution are subject to the Boost Software License, |
| 3 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 4 | // http://www.boost.org/LICENSE_1_0.txt). |
| 5 | // |
| 6 | // See http://www.boost.org/libs/type_traits for most recent version including documentation. |
| 7 | |
| 8 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 9 | #ifndef NDNBOOST_TT_DECAY_HPP_INCLUDED |
| 10 | #define NDNBOOST_TT_DECAY_HPP_INCLUDED |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 11 | |
| 12 | #include <ndnboost/type_traits/config.hpp> |
| 13 | #include <ndnboost/type_traits/is_array.hpp> |
| 14 | #include <ndnboost/type_traits/is_function.hpp> |
| 15 | #include <ndnboost/type_traits/remove_bounds.hpp> |
| 16 | #include <ndnboost/type_traits/add_pointer.hpp> |
| 17 | #include <ndnboost/type_traits/remove_reference.hpp> |
| 18 | #include <ndnboost/mpl/eval_if.hpp> |
| 19 | #include <ndnboost/mpl/identity.hpp> |
| 20 | |
| 21 | namespace ndnboost |
| 22 | { |
| 23 | |
| 24 | template< class T > |
| 25 | struct decay |
| 26 | { |
| 27 | private: |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 28 | typedef NDNBOOST_DEDUCED_TYPENAME remove_reference<T>::type Ty; |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 29 | public: |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 30 | typedef NDNBOOST_DEDUCED_TYPENAME mpl::eval_if< |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 31 | is_array<Ty>, |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 32 | mpl::identity<NDNBOOST_DEDUCED_TYPENAME remove_bounds<Ty>::type*>, |
| 33 | NDNBOOST_DEDUCED_TYPENAME mpl::eval_if< |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 34 | is_function<Ty>, |
| 35 | add_pointer<Ty>, |
| 36 | mpl::identity<Ty> |
| 37 | > |
| 38 | >::type type; |
| 39 | }; |
| 40 | |
| 41 | } // namespace ndnboost |
| 42 | |
| 43 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 44 | #endif // NDNBOOST_TT_DECAY_HPP_INCLUDED |