Back to home page

EIC code displayed by LXR

 
 

    


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

0001 
0002 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
0003 //  Use, modification and distribution are subject to the Boost Software License,
0004 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 //  http://www.boost.org/LICENSE_1_0.txt).
0006 //
0007 //  See http://www.boost.org/libs/type_traits for most recent version including documentation.
0008 
0009 #ifndef BOOST_TT_ADD_POINTER_HPP_INCLUDED
0010 #define BOOST_TT_ADD_POINTER_HPP_INCLUDED
0011 
0012 #include <boost/type_traits/remove_reference.hpp>
0013 
0014 namespace boost {
0015 
0016 #if defined(BOOST_BORLANDC) && (BOOST_BORLANDC < 0x5A0)
0017 //
0018 // For some reason this implementation stops Borlands compiler
0019 // from dropping cv-qualifiers, it still fails with references
0020 // to arrays for some reason though (shrug...) (JM 20021104)
0021 //
0022 template <typename T>
0023 struct add_pointer
0024 {
0025     typedef T* type;
0026 };
0027 template <typename T>
0028 struct add_pointer<T&>
0029 {
0030     typedef T* type;
0031 };
0032 template <typename T>
0033 struct add_pointer<T&const>
0034 {
0035     typedef T* type;
0036 };
0037 template <typename T>
0038 struct add_pointer<T&volatile>
0039 {
0040     typedef T* type;
0041 };
0042 template <typename T>
0043 struct add_pointer<T&const volatile>
0044 {
0045     typedef T* type;
0046 };
0047 
0048 #else
0049 
0050 template <typename T>
0051 struct add_pointer
0052 {
0053     typedef typename remove_reference<T>::type no_ref_type;
0054     typedef no_ref_type* type;
0055 };
0056 
0057 #endif
0058 
0059 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0060 
0061    template <class T> using add_pointer_t = typename add_pointer<T>::type;
0062 
0063 #endif
0064 
0065 } // namespace boost
0066 
0067 #endif // BOOST_TT_ADD_POINTER_HPP_INCLUDED