annotate DEPENDENCIES/generic/include/boost/phoenix/bind/detail/member_function_ptr.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents c530137014c0
children
rev   line source
Chris@16 1 /*=============================================================================
Chris@16 2 Copyright (c) 2001-2007 Joel de Guzman
Chris@16 3
Chris@16 4 Distributed under the Boost Software License, Version 1.0. (See accompanying
Chris@16 5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 6 ==============================================================================*/
Chris@16 7
Chris@16 8 #if !BOOST_PHOENIX_IS_ITERATING
Chris@16 9
Chris@16 10 #ifndef BOOST_PHOENIX_BIND_DETAIL_MEMBER_FUNCTION_PTR_HPP
Chris@16 11 #define BOOST_PHOENIX_BIND_DETAIL_MEMBER_FUNCTION_PTR_HPP
Chris@16 12
Chris@16 13 #include <boost/phoenix/core/limits.hpp>
Chris@16 14 #include <boost/phoenix/support/iterate.hpp>
Chris@16 15
Chris@16 16 namespace boost { namespace phoenix { namespace detail
Chris@16 17 {
Chris@16 18 template <int N>
Chris@16 19 struct member_function_ptr_impl
Chris@16 20 {
Chris@16 21 template <typename RT, typename FP>
Chris@16 22 struct impl;
Chris@16 23 };
Chris@16 24
Chris@16 25 template <int N, typename RT, typename FP>
Chris@16 26 struct member_function_ptr
Chris@16 27 : member_function_ptr_impl<N>::template impl<RT, FP>
Chris@16 28 {
Chris@16 29 typedef typename member_function_ptr_impl<N>::
Chris@16 30 template impl<RT, FP> base;
Chris@101 31 member_function_ptr(FP fp_)
Chris@101 32 : base(fp_) {}
Chris@16 33
Chris@16 34 using base::fp;
Chris@16 35
Chris@16 36 bool operator==(member_function_ptr const & rhs) const
Chris@16 37 {
Chris@16 38 return fp == rhs.fp;
Chris@16 39 }
Chris@16 40
Chris@16 41 template <int M, typename RhsRT, typename RhsFP>
Chris@101 42 bool operator==(member_function_ptr<M, RhsRT, RhsFP> const &) const
Chris@16 43 {
Chris@16 44 return false;
Chris@16 45 }
Chris@16 46 };
Chris@16 47
Chris@16 48 template <>
Chris@16 49 struct member_function_ptr_impl<0>
Chris@16 50 {
Chris@16 51 template <typename RT, typename FP>
Chris@16 52 struct impl
Chris@16 53 {
Chris@16 54 typedef RT result_type;
Chris@16 55
Chris@101 56 impl(FP fp_)
Chris@101 57 : fp(fp_) {}
Chris@16 58
Chris@16 59 template <typename Class>
Chris@16 60 RT operator()(Class& obj) const
Chris@16 61 {
Chris@16 62 BOOST_PROTO_USE_GET_POINTER();
Chris@16 63
Chris@16 64 typedef typename proto::detail::class_member_traits<FP>::class_type class_type;
Chris@16 65 return (BOOST_PROTO_GET_POINTER(class_type, obj) ->*fp)();
Chris@16 66 }
Chris@16 67
Chris@16 68 template <typename Class>
Chris@16 69 RT operator()(Class* obj) const
Chris@16 70 {
Chris@16 71 return (obj->*fp)();
Chris@16 72 }
Chris@16 73
Chris@16 74 FP fp;
Chris@16 75 };
Chris@16 76 };
Chris@16 77
Chris@16 78 #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
Chris@16 79 #include <boost/phoenix/bind/detail/preprocessed/member_function_ptr.hpp>
Chris@16 80 #else
Chris@16 81
Chris@16 82 #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
Chris@16 83 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/member_function_ptr_" BOOST_PHOENIX_LIMIT_STR ".hpp")
Chris@16 84 #endif
Chris@16 85
Chris@16 86 /*=============================================================================
Chris@16 87 Copyright (c) 2001-2007 Joel de Guzman
Chris@16 88
Chris@16 89 Distributed under the Boost Software License, Version 1.0. (See accompanying
Chris@16 90 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 91 ==============================================================================*/
Chris@16 92
Chris@16 93 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
Chris@16 94 #pragma wave option(preserve: 1)
Chris@16 95 #endif
Chris@16 96
Chris@16 97 #define BOOST_PHOENIX_ITERATION_PARAMS \
Chris@16 98 (3, (1, BOOST_PHOENIX_COMPOSITE_LIMIT, \
Chris@16 99 <boost/phoenix/bind/detail/member_function_ptr.hpp>))
Chris@16 100 #include BOOST_PHOENIX_ITERATE()
Chris@16 101
Chris@16 102 #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
Chris@16 103 #pragma wave option(output: null)
Chris@16 104 #endif
Chris@16 105
Chris@16 106 #endif
Chris@16 107
Chris@16 108 }}} // namespace boost::phoenix::detail
Chris@16 109
Chris@16 110 #endif
Chris@16 111
Chris@16 112 ///////////////////////////////////////////////////////////////////////////////
Chris@16 113 //
Chris@16 114 // Preprocessor vertical repetition code
Chris@16 115 //
Chris@16 116 ///////////////////////////////////////////////////////////////////////////////
Chris@16 117 #else
Chris@16 118
Chris@16 119 template <>
Chris@16 120 struct member_function_ptr_impl<BOOST_PHOENIX_ITERATION>
Chris@16 121 {
Chris@16 122 template <typename RT, typename FP>
Chris@16 123 struct impl
Chris@16 124 {
Chris@16 125 typedef RT result_type;
Chris@16 126
Chris@101 127 impl(FP fp_)
Chris@101 128 : fp(fp_) {}
Chris@16 129
Chris@16 130 template <typename Class, BOOST_PHOENIX_typename_A>
Chris@16 131 RT operator()(Class& obj, BOOST_PHOENIX_A_ref_a) const
Chris@16 132 {
Chris@16 133 BOOST_PROTO_USE_GET_POINTER();
Chris@16 134
Chris@16 135 typedef typename proto::detail::class_member_traits<FP>::class_type class_type;
Chris@16 136 return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(BOOST_PHOENIX_a);
Chris@16 137 }
Chris@16 138
Chris@16 139 template <typename Class, BOOST_PHOENIX_typename_A>
Chris@16 140 RT operator()(Class* obj, BOOST_PHOENIX_A_ref_a) const
Chris@16 141 {
Chris@16 142 return (obj->*fp)(BOOST_PHOENIX_a);
Chris@16 143 }
Chris@16 144
Chris@16 145 FP fp;
Chris@16 146 };
Chris@16 147 };
Chris@16 148
Chris@16 149 #endif // defined(BOOST_PP_IS_ITERATING)