Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:53:25

0001 //////////////////////////////////////////////////////////////////////////////
0002 // (C) Copyright John Maddock 2000.
0003 // (C) Copyright Ion Gaztanaga 2005-2012.
0004 //
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // (See accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 //
0009 // See http://www.boost.org/libs/interprocess for documentation.
0010 //
0011 //////////////////////////////////////////////////////////////////////////////
0012 
0013 #ifndef BOOST_INTERPROCESS_DETAIL_TYPE_TRAITS_HPP
0014 #define BOOST_INTERPROCESS_DETAIL_TYPE_TRAITS_HPP
0015 
0016 #ifndef BOOST_CONFIG_HPP
0017 #  include <boost/config.hpp>
0018 #endif
0019 #
0020 #if defined(BOOST_HAS_PRAGMA_ONCE)
0021 #  pragma once
0022 #endif
0023 
0024 #include <boost/interprocess/detail/config_begin.hpp>
0025 
0026 namespace boost {
0027 namespace interprocess {
0028 namespace ipcdetail {
0029 
0030 struct nat{};
0031 
0032 template<class T>
0033 struct remove_reference
0034 {
0035    typedef T type;
0036 };
0037 
0038 template<class T>
0039 struct remove_reference<T&>
0040 {
0041    typedef T type;
0042 };
0043 
0044 template<class T>
0045 struct is_reference
0046 {
0047    static const bool value = false;
0048 };
0049 
0050 template<class T>
0051 struct is_reference<T&>
0052 {
0053    static const bool value = true;
0054 };
0055 
0056 template<class T>
0057 struct is_pointer
0058 {
0059    static const bool value = false;
0060 };
0061 
0062 template<class T>
0063 struct is_pointer<T*>
0064 {
0065    static const bool value = true;
0066 };
0067 
0068 template <typename T>
0069 struct add_reference
0070 {
0071     typedef T& type;
0072 };
0073 
0074 template<class T>
0075 struct add_reference<T&>
0076 {
0077     typedef T& type;
0078 };
0079 
0080 template<>
0081 struct add_reference<void>
0082 {
0083     typedef nat &type;
0084 };
0085 
0086 template<>
0087 struct add_reference<const void>
0088 {
0089     typedef const nat &type;
0090 };
0091 
0092 template <class T>
0093 struct add_const_reference
0094 {  typedef const T &type;   };
0095 
0096 template <class T>
0097 struct add_const_reference<T&>
0098 {  typedef T& type;   };
0099 
0100 template<class T>
0101 struct remove_const
0102 {
0103    typedef T type;
0104 };
0105 
0106 template<class T>
0107 struct remove_const<const T>
0108 {
0109    typedef T type;
0110 };
0111 
0112 template<class T>
0113 struct remove_volatile
0114 {
0115    typedef T type;
0116 };
0117 
0118 template<class T>
0119 struct remove_volatile<volatile T>
0120 {
0121    typedef T type;
0122 };
0123 
0124 template<class T>
0125 struct remove_const_volatile
0126 {
0127    typedef typename remove_const<typename remove_volatile<T>::type>::type type;
0128 };
0129 
0130 template <typename T, typename U>
0131 struct is_same
0132 {
0133    typedef char yes_type;
0134    struct no_type
0135    {
0136       char padding[8];
0137    };
0138 
0139    template <typename V>
0140    static yes_type is_same_tester(V*, V*);
0141    static no_type is_same_tester(...);
0142 
0143    static T *t;
0144    static U *u;
0145 
0146    static const bool value = sizeof(yes_type) == sizeof(is_same_tester(t,u));
0147 };
0148 
0149 template<class T, class U>
0150 struct is_cv_same
0151 {
0152    static const bool value = is_same< typename remove_const_volatile<T>::type
0153                                     , typename remove_const_volatile<U>::type >::value;
0154 };
0155 
0156 } // namespace ipcdetail
0157 }  //namespace interprocess {
0158 }  //namespace boost {
0159 
0160 #include <boost/interprocess/detail/config_end.hpp>
0161 
0162 #endif   //#ifndef BOOST_INTERPROCESS_DETAIL_TYPE_TRAITS_HPP