blob: 7e736dc3f7c0c40bd227bc492c3e6f655a483947 [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001// (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 Thompson3d613fd2013-10-15 15:39:04 -07009#ifndef NDNBOOST_TT_DECAY_HPP_INCLUDED
10#define NDNBOOST_TT_DECAY_HPP_INCLUDED
Jeff Thompsona28eed82013-08-22 16:21:10 -070011
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
21namespace ndnboost
22{
23
24 template< class T >
25 struct decay
26 {
27 private:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070028 typedef NDNBOOST_DEDUCED_TYPENAME remove_reference<T>::type Ty;
Jeff Thompsona28eed82013-08-22 16:21:10 -070029 public:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070030 typedef NDNBOOST_DEDUCED_TYPENAME mpl::eval_if<
Jeff Thompsona28eed82013-08-22 16:21:10 -070031 is_array<Ty>,
Jeff Thompson3d613fd2013-10-15 15:39:04 -070032 mpl::identity<NDNBOOST_DEDUCED_TYPENAME remove_bounds<Ty>::type*>,
33 NDNBOOST_DEDUCED_TYPENAME mpl::eval_if<
Jeff Thompsona28eed82013-08-22 16:21:10 -070034 is_function<Ty>,
35 add_pointer<Ty>,
36 mpl::identity<Ty>
37 >
38 >::type type;
39 };
40
41} // namespace ndnboost
42
43
Jeff Thompson3d613fd2013-10-15 15:39:04 -070044#endif // NDNBOOST_TT_DECAY_HPP_INCLUDED