comparison DEPENDENCIES/generic/include/boost/multi_index/global_fun.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
1 /* Copyright 2003-2008 Joaquin M Lopez Munoz. 1 /* Copyright 2003-2013 Joaquin M Lopez Munoz.
2 * Distributed under the Boost Software License, Version 1.0. 2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at 3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt) 4 * http://www.boost.org/LICENSE_1_0.txt)
5 * 5 *
6 * See http://www.boost.org/libs/multi_index for library home page. 6 * See http://www.boost.org/libs/multi_index for library home page.
7 */ 7 */
8 8
9 #ifndef BOOST_MULTI_INDEX_GLOBAL_FUN_HPP 9 #ifndef BOOST_MULTI_INDEX_GLOBAL_FUN_HPP
10 #define BOOST_MULTI_INDEX_GLOBAL_FUN_HPP 10 #define BOOST_MULTI_INDEX_GLOBAL_FUN_HPP
11 11
12 #if defined(_MSC_VER)&&(_MSC_VER>=1200) 12 #if defined(_MSC_VER)
13 #pragma once 13 #pragma once
14 #endif 14 #endif
15 15
16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */ 16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
17 #include <boost/mpl/if.hpp> 17 #include <boost/mpl/if.hpp>
44 * *...n...*x is convertible to T&, for some n>=1. 44 * *...n...*x is convertible to T&, for some n>=1.
45 * Examples of chained pointers are raw and smart pointers, iterators and 45 * Examples of chained pointers are raw and smart pointers, iterators and
46 * arbitrary combinations of these (vg. T** or auto_ptr<T*>.) 46 * arbitrary combinations of these (vg. T** or auto_ptr<T*>.)
47 */ 47 */
48 48
49 /* NB. Some overloads of operator() have an extra dummy parameter int=0.
50 * This disambiguator serves several purposes:
51 * - Without it, MSVC++ 6.0 incorrectly regards some overloads as
52 * specializations of a previous member function template.
53 * - MSVC++ 6.0/7.0 seem to incorrectly treat some different memfuns
54 * as if they have the same signature.
55 * - If remove_const is broken due to lack of PTS, int=0 avoids the
56 * declaration of memfuns with identical signature.
57 */
58
59 template<class Value,typename Type,Type (*PtrToFunction)(Value)> 49 template<class Value,typename Type,Type (*PtrToFunction)(Value)>
60 struct const_ref_global_fun_base 50 struct const_ref_global_fun_base
61 { 51 {
62 typedef typename remove_reference<Type>::type result_type; 52 typedef typename remove_reference<Type>::type result_type;
63 53
88 } 78 }
89 79
90 Type operator()( 80 Type operator()(
91 const reference_wrapper< 81 const reference_wrapper<
92 typename remove_const< 82 typename remove_const<
93 typename remove_reference<Value>::type>::type>& x,int=0)const 83 typename remove_reference<Value>::type>::type>& x)const
94 { 84 {
95 return operator()(x.get()); 85 return operator()(x.get());
96 } 86 }
97 }; 87 };
98 88
156 { 146 {
157 return operator()(x.get()); 147 return operator()(x.get());
158 } 148 }
159 149
160 Type operator()( 150 Type operator()(
161 const reference_wrapper< 151 const reference_wrapper<typename remove_const<Value>::type>& x)const
162 typename remove_const<Value>::type>& x,int=0)const
163 { 152 {
164 return operator()(x.get()); 153 return operator()(x.get());
165 } 154 }
166 }; 155 };
167 156