Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 1 | |
| 2 | // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. |
| 3 | // Use, modification and distribution are subject to the Boost Software License, |
| 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 5 | // http://www.boost.org/LICENSE_1_0.txt). |
| 6 | // |
| 7 | // See http://www.boost.org/libs/type_traits for most recent version including documentation. |
| 8 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 9 | #ifndef NDNBOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED |
| 10 | #define NDNBOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 11 | |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 12 | #include <ndnboost/type_traits/broken_compiler_spec.hpp> |
| 13 | #include <ndnboost/config.hpp> |
| 14 | #include <ndnboost/detail/workaround.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 15 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 16 | #if NDNBOOST_WORKAROUND(NDNBOOST_MSVC,<=1300) |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 17 | #include <ndnboost/type_traits/msvc/remove_reference.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 18 | #endif |
| 19 | |
| 20 | // should be the last #include |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 21 | #include <ndnboost/type_traits/detail/type_trait_def.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 22 | |
| 23 | namespace ndnboost { |
| 24 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 25 | #ifndef NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 26 | |
| 27 | namespace detail{ |
| 28 | // |
| 29 | // We can't filter out rvalue_references at the same level as |
| 30 | // references or we get ambiguities from msvc: |
| 31 | // |
| 32 | template <class T> |
| 33 | struct remove_rvalue_ref |
| 34 | { |
| 35 | typedef T type; |
| 36 | }; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 37 | #ifndef NDNBOOST_NO_CXX11_RVALUE_REFERENCES |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 38 | template <class T> |
| 39 | struct remove_rvalue_ref<T&&> |
| 40 | { |
| 41 | typedef T type; |
| 42 | }; |
| 43 | #endif |
| 44 | |
| 45 | } // namespace detail |
| 46 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 47 | NDNBOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_reference,T,typename ndnboost::detail::remove_rvalue_ref<T>::type) |
| 48 | NDNBOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T&,T) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 49 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 50 | #if defined(NDNBOOST_ILLEGAL_CV_REFERENCES) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 51 | // these are illegal specialisations; cv-qualifies applied to |
| 52 | // references have no effect according to [8.3.2p1], |
| 53 | // C++ Builder requires them though as it treats cv-qualified |
| 54 | // references as distinct types... |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 55 | NDNBOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& const,T) |
| 56 | NDNBOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& volatile,T) |
| 57 | NDNBOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& const volatile,T) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 58 | #endif |
| 59 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 60 | #elif !NDNBOOST_WORKAROUND(NDNBOOST_MSVC,<=1300) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 61 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 62 | NDNBOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_reference,T,typename ndnboost::detail::remove_reference_impl<T>::type) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 63 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 64 | #endif // NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 65 | |
| 66 | } // namespace ndnboost |
| 67 | |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 68 | #include <ndnboost/type_traits/detail/type_trait_undef.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 69 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 70 | #endif // NDNBOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED |