This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch]: Remove unnecessary overloads in stl_function.h
- From: Chris Jefferson <caj at cs dot york dot ac dot uk>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 03 Jan 2005 23:40:07 +0000
- Subject: Re: [patch]: Remove unnecessary overloads in stl_function.h
- References: <41D9C133.5060709@cs.york.ac.uk> <41D9C290.7090004@suse.de>
Paolo Carlini wrote:
caj wrote:
The following patch removes the unnessasary overloads and adds a test
file.
Can I ask you again to use a plain 'diff -pr' of the whole patched
libstdc++-v3,
which makes the task of downloading and applying your patch much
easier for
the maintainers?
Sorry, here it is.
The testcase is still attached to my previous message, as diff -pr
doesn't pick it up? Sticking a -N will make it do it however. Should I
do this?
Chris
diff -pr libstdc++-v3.so_7.plain/include/bits/stl_function.h libstdc++-v3.so_7.patch/include/bits/stl_function.h
*** libstdc++-v3.so_7.plain/include/bits/stl_function.h 2005-01-03 23:14:33.082208440 +0000
--- libstdc++-v3.so_7.patch/include/bits/stl_function.h 2005-01-03 21:37:58.930673000 +0000
*************** namespace std
*** 566,584 ****
// 20.3.8 adaptors pointers members
/** @defgroup s20_3_8_memadaptors Adaptors for pointers to members
! * There are a total of 16 = 2^4 function objects in this family.
* (1) Member functions taking no arguments vs member functions taking
* one argument.
* (2) Call through pointer vs call through reference.
! * (3) Member function with void return type vs member function with
! * non-void return type.
! * (4) Const vs non-const member function.
! *
! * Note that choice (3) is nothing more than a workaround: according
! * to the draft, compilers should handle void and non-void the same way.
! * This feature is not yet widely implemented, though. You can only use
! * member functions returning void if your compiler supports partial
! * specialization.
*
* All of this complexity is in the function objects themselves. You can
* ignore it by using the helper function mem_fun and mem_fun_ref,
--- 566,576 ----
// 20.3.8 adaptors pointers members
/** @defgroup s20_3_8_memadaptors Adaptors for pointers to members
! * There are a total of 8 = 2^3 function objects in this family.
* (1) Member functions taking no arguments vs member functions taking
* one argument.
* (2) Call through pointer vs call through reference.
! * (3) Const vs non-const member function.
*
* All of this complexity is in the function objects themselves. You can
* ignore it by using the helper function mem_fun and mem_fun_ref,
*************** namespace std
*** 714,850 ****
_Ret (_Tp::*_M_f)(_Arg) const;
};
- /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
- template <class _Tp>
- class mem_fun_t<void, _Tp> : public unary_function<_Tp*, void>
- {
- public:
- explicit
- mem_fun_t(void (_Tp::*__pf)())
- : _M_f(__pf) {}
-
- void
- operator()(_Tp* __p) const
- { (__p->*_M_f)(); }
- private:
- void (_Tp::*_M_f)();
- };
-
- /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
- template <class _Tp>
- class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*, void>
- {
- public:
- explicit
- const_mem_fun_t(void (_Tp::*__pf)() const)
- : _M_f(__pf) {}
-
- void
- operator()(const _Tp* __p) const
- { (__p->*_M_f)(); }
- private:
- void (_Tp::*_M_f)() const;
- };
-
- /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
- template <class _Tp>
- class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp, void>
- {
- public:
- explicit
- mem_fun_ref_t(void (_Tp::*__pf)())
- : _M_f(__pf) {}
-
- void
- operator()(_Tp& __r) const
- { (__r.*_M_f)(); }
- private:
- void (_Tp::*_M_f)();
- };
-
- /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
- template <class _Tp>
- class const_mem_fun_ref_t<void, _Tp> : public unary_function<_Tp, void>
- {
- public:
- explicit
- const_mem_fun_ref_t(void (_Tp::*__pf)() const)
- : _M_f(__pf) {}
-
- void
- operator()(const _Tp& __r) const
- { (__r.*_M_f)(); }
- private:
- void (_Tp::*_M_f)() const;
- };
-
- /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
- template <class _Tp, class _Arg>
- class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*, _Arg, void>
- {
- public:
- explicit
- mem_fun1_t(void (_Tp::*__pf)(_Arg))
- : _M_f(__pf) {}
-
- void
- operator()(_Tp* __p, _Arg __x) const
- { (__p->*_M_f)(__x); }
- private:
- void (_Tp::*_M_f)(_Arg);
- };
-
- /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
- template <class _Tp, class _Arg>
- class const_mem_fun1_t<void, _Tp, _Arg>
- : public binary_function<const _Tp*, _Arg, void>
- {
- public:
- explicit
- const_mem_fun1_t(void (_Tp::*__pf)(_Arg) const)
- : _M_f(__pf) {}
-
- void
- operator()(const _Tp* __p, _Arg __x) const
- { (__p->*_M_f)(__x); }
- private:
- void (_Tp::*_M_f)(_Arg) const;
- };
-
- /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
- template <class _Tp, class _Arg>
- class mem_fun1_ref_t<void, _Tp, _Arg>
- : public binary_function<_Tp, _Arg, void>
- {
- public:
- explicit
- mem_fun1_ref_t(void (_Tp::*__pf)(_Arg))
- : _M_f(__pf) {}
-
- void
- operator()(_Tp& __r, _Arg __x) const
- { (__r.*_M_f)(__x); }
- private:
- void (_Tp::*_M_f)(_Arg);
- };
-
- /// One of the @link s20_3_8_memadaptors adaptors for member pointers@endlink.
- template <class _Tp, class _Arg>
- class const_mem_fun1_ref_t<void, _Tp, _Arg>
- : public binary_function<_Tp, _Arg, void>
- {
- public:
- explicit
- const_mem_fun1_ref_t(void (_Tp::*__pf)(_Arg) const)
- : _M_f(__pf) {}
-
- void
- operator()(const _Tp& __r, _Arg __x) const
- { (__r.*_M_f)(__x); }
- private:
- void (_Tp::*_M_f)(_Arg) const;
- };
-
// Mem_fun adaptor helper functions. There are only two:
// mem_fun and mem_fun_ref.
template <class _Ret, class _Tp>
--- 706,711 ----
Only in libstdc++-v3.so_7.patch/testsuite/20_util/functional: binders