Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:33:07

0001 //  (C) Copyright John Maddock & Thorsten Ottosen 2005.
0002 //  Use, modification and distribution are subject to the Boost Software License,
0003 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0004 //  http://www.boost.org/LICENSE_1_0.txt).
0005 //
0006 //  See http://www.boost.org/libs/type_traits for most recent version including documentation.
0007 
0008 
0009 #ifndef BOOST_TT_DECAY_HPP_INCLUDED
0010 #define BOOST_TT_DECAY_HPP_INCLUDED
0011 
0012 #include <boost/type_traits/is_array.hpp>
0013 #include <boost/type_traits/is_function.hpp>
0014 #include <boost/type_traits/remove_bounds.hpp>
0015 #include <boost/type_traits/add_pointer.hpp>
0016 #include <boost/type_traits/remove_reference.hpp>
0017 #include <boost/type_traits/remove_cv.hpp>
0018 
0019 namespace boost 
0020 {
0021 
0022    namespace detail
0023    {
0024 
0025       template <class T, bool Array, bool Function> struct decay_imp { typedef typename remove_cv<T>::type type; };
0026       template <class T> struct decay_imp<T, true, false> { typedef typename remove_bounds<T>::type* type; };
0027       template <class T> struct decay_imp<T, false, true> { typedef T* type; };
0028 
0029    }
0030 
0031     template< class T >
0032     struct decay
0033     {
0034     private:
0035         typedef typename remove_reference<T>::type Ty;
0036     public:
0037        typedef typename boost::detail::decay_imp<Ty, boost::is_array<Ty>::value, boost::is_function<Ty>::value>::type type;
0038     };
0039     
0040 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0041 
0042    template <class T> using decay_t = typename decay<T>::type;
0043 
0044 #endif
0045 
0046 } // namespace boost
0047 
0048 
0049 #endif // BOOST_TT_DECAY_HPP_INCLUDED