__opr as a parameter name
Martin von Loewis
loewis@informatik.hu-berlin.de
Sun Jul 11 12:37:00 GMT 1999
The change
1999-06-17 Alexandre Oliva <oliva@dcc.unicamp.br>
* stl_algo.h (transform): Rename __opr to __oper, as __opr is used
internally by egcs.
Reported by Harri Porten <porten@tu-harburg.de>
provides a work-around for an egcs bug where it will reject code that
uses __opr as a parameter name. Unfortunately, that change was
incomplete, the error remains in stl_function and stl_numeric. Here is
another patch.
As this falls into the "embarassing" category, I think it should be
integrated into gcc 2.95.
Regards,
Martin
1999-07-11 Martin v. Löwis (loewis@informatik.hu-berlin.de)
* stl_function.h (bind1st, bind2nd): Rename __opr to __oper,
as __opr is used internally by egcs.
* stl_numeric.h (__power, power): Likewise.
Index: stl_function.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libstdc++/stl/stl_function.h,v
retrieving revision 1.2
diff -u -r1.2 stl_function.h
--- stl_function.h 1998/09/02 17:24:48 1.2
+++ stl_function.h 1999/07/11 19:30:19
@@ -202,10 +202,10 @@
template <class _Operation, class _Tp>
inline binder1st<_Operation>
-bind1st(const _Operation& __opr, const _Tp& __x)
+bind1st(const _Operation& __oper, const _Tp& __x)
{
typedef typename _Operation::first_argument_type _Arg1_type;
- return binder1st<_Operation>(__opr, _Arg1_type(__x));
+ return binder1st<_Operation>(__oper, _Arg1_type(__x));
}
template <class _Operation>
@@ -227,10 +227,10 @@
template <class _Operation, class _Tp>
inline binder2nd<_Operation>
-bind2nd(const _Operation& __opr, const _Tp& __x)
+bind2nd(const _Operation& __oper, const _Tp& __x)
{
typedef typename _Operation::second_argument_type _Arg2_type;
- return binder2nd<_Operation>(__opr, _Arg2_type(__x));
+ return binder2nd<_Operation>(__oper, _Arg2_type(__x));
}
// unary_compose and binary_compose (extensions, not part of the standard).
Index: stl_numeric.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libstdc++/stl/stl_numeric.h,v
retrieving revision 1.2
diff -u -r1.2 stl_numeric.h
--- stl_numeric.h 1998/09/02 17:25:00 1.2
+++ stl_numeric.h 1999/07/11 19:30:19
@@ -177,22 +177,22 @@
template <class _Tp, class _Integer, class _MonoidOperation>
-_Tp __power(_Tp __x, _Integer __n, _MonoidOperation __opr)
+_Tp __power(_Tp __x, _Integer __n, _MonoidOperation __oper)
{
if (__n == 0)
- return identity_element(__opr);
+ return identity_element(__oper);
else {
while ((__n & 1) == 0) {
__n >>= 1;
- __x = __opr(__x, __x);
+ __x = __oper(__x, __x);
}
_Tp __result = __x;
__n >>= 1;
while (__n != 0) {
- __x = __opr(__x, __x);
+ __x = __oper(__x, __x);
if ((__n & 1) != 0)
- __result = __opr(__result, __x);
+ __result = __oper(__result, __x);
__n >>= 1;
}
return __result;
@@ -209,9 +209,9 @@
// not part of the C++ standard.
template <class _Tp, class _Integer, class _MonoidOperation>
-inline _Tp power(_Tp __x, _Integer __n, _MonoidOperation __opr)
+inline _Tp power(_Tp __x, _Integer __n, _MonoidOperation __oper)
{
- return __power(__x, __n, __opr);
+ return __power(__x, __n, __oper);
}
template <class _Tp, class _Integer>
More information about the Gcc-patches
mailing list