From c003db1fcae660d055b1b29852065f67bbabd35e Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Tue, 29 Nov 2011 18:15:50 +0000 Subject: Further macro protection by replacing _[A-Z] with _[A-Z]p llvm-svn: 145410 --- libcxx/include/__functional_base | 180 +++++++++++++++++++-------------------- 1 file changed, 90 insertions(+), 90 deletions(-) (limited to 'libcxx/include/__functional_base') diff --git a/libcxx/include/__functional_base b/libcxx/include/__functional_base index 8d8e4b5e6e9..2ec3e49596c 100644 --- a/libcxx/include/__functional_base +++ b/libcxx/include/__functional_base @@ -64,9 +64,9 @@ struct __derives_from_unary_function private: struct __two {char _; char __;}; static __two __test(...); - template - static unary_function<_A, _R> - __test(const volatile unary_function<_A, _R>*); + template + static unary_function<_Ap, _Rp> + __test(const volatile unary_function<_Ap, _Rp>*); public: static const bool value = !is_same::value; typedef decltype(__test((_Tp*)0)) type; @@ -78,9 +78,9 @@ struct __derives_from_binary_function private: struct __two {char _; char __;}; static __two __test(...); - template - static binary_function<_A1, _A2, _R> - __test(const volatile binary_function<_A1, _A2, _R>*); + template + static binary_function<_A1, _A2, _Rp> + __test(const volatile binary_function<_A1, _A2, _Rp>*); public: static const bool value = !is_same::value; typedef decltype(__test((_Tp*)0)) type; @@ -131,173 +131,173 @@ struct __weak_result_type // 0 argument case -template -struct __weak_result_type<_R ()> +template +struct __weak_result_type<_Rp ()> { - typedef _R result_type; + typedef _Rp result_type; }; -template -struct __weak_result_type<_R (&)()> +template +struct __weak_result_type<_Rp (&)()> { - typedef _R result_type; + typedef _Rp result_type; }; -template -struct __weak_result_type<_R (*)()> +template +struct __weak_result_type<_Rp (*)()> { - typedef _R result_type; + typedef _Rp result_type; }; // 1 argument case -template -struct __weak_result_type<_R (_A1)> - : public unary_function<_A1, _R> +template +struct __weak_result_type<_Rp (_A1)> + : public unary_function<_A1, _Rp> { }; -template -struct __weak_result_type<_R (&)(_A1)> - : public unary_function<_A1, _R> +template +struct __weak_result_type<_Rp (&)(_A1)> + : public unary_function<_A1, _Rp> { }; -template -struct __weak_result_type<_R (*)(_A1)> - : public unary_function<_A1, _R> +template +struct __weak_result_type<_Rp (*)(_A1)> + : public unary_function<_A1, _Rp> { }; -template -struct __weak_result_type<_R (_C::*)()> - : public unary_function<_C*, _R> +template +struct __weak_result_type<_Rp (_Cp::*)()> + : public unary_function<_Cp*, _Rp> { }; -template -struct __weak_result_type<_R (_C::*)() const> - : public unary_function +template +struct __weak_result_type<_Rp (_Cp::*)() const> + : public unary_function { }; -template -struct __weak_result_type<_R (_C::*)() volatile> - : public unary_function +template +struct __weak_result_type<_Rp (_Cp::*)() volatile> + : public unary_function { }; -template -struct __weak_result_type<_R (_C::*)() const volatile> - : public unary_function +template +struct __weak_result_type<_Rp (_Cp::*)() const volatile> + : public unary_function { }; // 2 argument case -template -struct __weak_result_type<_R (_A1, _A2)> - : public binary_function<_A1, _A2, _R> +template +struct __weak_result_type<_Rp (_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> { }; -template -struct __weak_result_type<_R (*)(_A1, _A2)> - : public binary_function<_A1, _A2, _R> +template +struct __weak_result_type<_Rp (*)(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> { }; -template -struct __weak_result_type<_R (&)(_A1, _A2)> - : public binary_function<_A1, _A2, _R> +template +struct __weak_result_type<_Rp (&)(_A1, _A2)> + : public binary_function<_A1, _A2, _Rp> { }; -template -struct __weak_result_type<_R (_C::*)(_A1)> - : public binary_function<_C*, _A1, _R> +template +struct __weak_result_type<_Rp (_Cp::*)(_A1)> + : public binary_function<_Cp*, _A1, _Rp> { }; -template -struct __weak_result_type<_R (_C::*)(_A1) const> - : public binary_function +template +struct __weak_result_type<_Rp (_Cp::*)(_A1) const> + : public binary_function { }; -template -struct __weak_result_type<_R (_C::*)(_A1) volatile> - : public binary_function +template +struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile> + : public binary_function { }; -template -struct __weak_result_type<_R (_C::*)(_A1) const volatile> - : public binary_function +template +struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile> + : public binary_function { }; // 3 or more arguments -template -struct __weak_result_type<_R (_A1, _A2, _A3, _A4...)> +template +struct __weak_result_type<_Rp (_A1, _A2, _A3, _A4...)> { - typedef _R result_type; + typedef _Rp result_type; }; -template -struct __weak_result_type<_R (&)(_A1, _A2, _A3, _A4...)> +template +struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)> { - typedef _R result_type; + typedef _Rp result_type; }; -template -struct __weak_result_type<_R (*)(_A1, _A2, _A3, _A4...)> +template +struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)> { - typedef _R result_type; + typedef _Rp result_type; }; -template -struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...)> +template +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...)> { - typedef _R result_type; + typedef _Rp result_type; }; -template -struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) const> +template +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const> { - typedef _R result_type; + typedef _Rp result_type; }; -template -struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) volatile> +template +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) volatile> { - typedef _R result_type; + typedef _Rp result_type; }; -template -struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) const volatile> +template +struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile> { - typedef _R result_type; + typedef _Rp result_type; }; // __invoke // bullets 1 and 2 -template +template inline _LIBCPP_INLINE_VISIBILITY auto -__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args) +__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...)) { return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...); } -template +template inline _LIBCPP_INLINE_VISIBILITY auto -__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args) +__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...)) { return ((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...); @@ -305,19 +305,19 @@ __invoke(_F&& __f, _A0&& __a0, _Args&& ...__args) // bullets 3 and 4 -template +template inline _LIBCPP_INLINE_VISIBILITY auto -__invoke(_F&& __f, _A0&& __a0) +__invoke(_Fp&& __f, _A0&& __a0) -> decltype(_VSTD::forward<_A0>(__a0).*__f) { return _VSTD::forward<_A0>(__a0).*__f; } -template +template inline _LIBCPP_INLINE_VISIBILITY auto -__invoke(_F&& __f, _A0&& __a0) +__invoke(_Fp&& __f, _A0&& __a0) -> decltype((*_VSTD::forward<_A0>(__a0)).*__f) { return (*_VSTD::forward<_A0>(__a0)).*__f; @@ -325,13 +325,13 @@ __invoke(_F&& __f, _A0&& __a0) // bullet 5 -template +template inline _LIBCPP_INLINE_VISIBILITY auto -__invoke(_F&& __f, _Args&& ...__args) - -> decltype(_VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...)) +__invoke(_Fp&& __f, _Args&& ...__args) + -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...)) { - return _VSTD::forward<_F>(__f)(_VSTD::forward<_Args>(__args)...); + return _VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...); } template -- cgit v1.2.3