Commit 7c920151 by Paolo Carlini Committed by Paolo Carlini

stl_function.h: Additional minor tweaks.

2004-02-02  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/stl_function.h: Additional minor tweaks.
	* include/bits/stl_multiset.h: Likewise.

	* include/bits/stl_queue.h: Minor tweaks.

From-SVN: r77125
parent 238b11b5
2004-02-02 Paolo Carlini <pcarlini@suse.de> 2004-02-02 Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_function.h: Additional minor tweaks.
* include/bits/stl_multiset.h: Likewise.
* include/bits/stl_queue.h: Minor tweaks.
2004-02-02 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/13976 (continued) PR libstdc++/13976 (continued)
* include/ext/malloc_allocator.h (malloc_allocator::deallocate): * include/ext/malloc_allocator.h (malloc_allocator::deallocate):
Make the second parameter unnamed, to void unused parameter Make the second parameter unnamed, to void unused parameter
......
...@@ -315,7 +315,8 @@ namespace std ...@@ -315,7 +315,8 @@ namespace std
protected: protected:
_Predicate _M_pred; _Predicate _M_pred;
public: public:
explicit unary_negate(const _Predicate& __x) : _M_pred(__x) {} explicit
unary_negate(const _Predicate& __x) : _M_pred(__x) {}
bool bool
operator()(const typename _Predicate::argument_type& __x) const operator()(const typename _Predicate::argument_type& __x) const
...@@ -338,7 +339,8 @@ namespace std ...@@ -338,7 +339,8 @@ namespace std
protected: protected:
_Predicate _M_pred; _Predicate _M_pred;
public: public:
explicit binary_negate(const _Predicate& __x) explicit
binary_negate(const _Predicate& __x)
: _M_pred(__x) { } : _M_pred(__x) { }
bool bool
...@@ -483,7 +485,8 @@ namespace std ...@@ -483,7 +485,8 @@ namespace std
public: public:
pointer_to_unary_function() {} pointer_to_unary_function() {}
explicit pointer_to_unary_function(_Result (*__x)(_Arg)) explicit
pointer_to_unary_function(_Result (*__x)(_Arg))
: _M_ptr(__x) {} : _M_ptr(__x) {}
_Result _Result
...@@ -507,7 +510,8 @@ namespace std ...@@ -507,7 +510,8 @@ namespace std
public: public:
pointer_to_binary_function() {} pointer_to_binary_function() {}
explicit pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2)) explicit
pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
: _M_ptr(__x) {} : _M_ptr(__x) {}
_Result _Result
...@@ -587,7 +591,8 @@ namespace std ...@@ -587,7 +591,8 @@ namespace std
class mem_fun_t : public unary_function<_Tp*, _Ret> class mem_fun_t : public unary_function<_Tp*, _Ret>
{ {
public: public:
explicit mem_fun_t(_Ret (_Tp::*__pf)()) explicit
mem_fun_t(_Ret (_Tp::*__pf)())
: _M_f(__pf) {} : _M_f(__pf) {}
_Ret _Ret
...@@ -602,7 +607,8 @@ namespace std ...@@ -602,7 +607,8 @@ namespace std
class const_mem_fun_t : public unary_function<const _Tp*, _Ret> class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
{ {
public: public:
explicit const_mem_fun_t(_Ret (_Tp::*__pf)() const) explicit
const_mem_fun_t(_Ret (_Tp::*__pf)() const)
: _M_f(__pf) {} : _M_f(__pf) {}
_Ret _Ret
...@@ -617,7 +623,8 @@ namespace std ...@@ -617,7 +623,8 @@ namespace std
class mem_fun_ref_t : public unary_function<_Tp, _Ret> class mem_fun_ref_t : public unary_function<_Tp, _Ret>
{ {
public: public:
explicit mem_fun_ref_t(_Ret (_Tp::*__pf)()) explicit
mem_fun_ref_t(_Ret (_Tp::*__pf)())
: _M_f(__pf) {} : _M_f(__pf) {}
_Ret _Ret
...@@ -632,7 +639,8 @@ namespace std ...@@ -632,7 +639,8 @@ namespace std
class const_mem_fun_ref_t : public unary_function<_Tp, _Ret> class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
{ {
public: public:
explicit const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const) explicit
const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const)
: _M_f(__pf) {} : _M_f(__pf) {}
_Ret _Ret
...@@ -647,7 +655,8 @@ namespace std ...@@ -647,7 +655,8 @@ namespace std
class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret> class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret>
{ {
public: public:
explicit mem_fun1_t(_Ret (_Tp::*__pf)(_Arg)) explicit
mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
: _M_f(__pf) {} : _M_f(__pf) {}
_Ret _Ret
...@@ -662,7 +671,8 @@ namespace std ...@@ -662,7 +671,8 @@ namespace std
class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret> class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret>
{ {
public: public:
explicit const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const) explicit
const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const)
: _M_f(__pf) {} : _M_f(__pf) {}
_Ret _Ret
...@@ -677,7 +687,8 @@ namespace std ...@@ -677,7 +687,8 @@ namespace std
class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret> class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
{ {
public: public:
explicit mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg)) explicit
mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg))
: _M_f(__pf) {} : _M_f(__pf) {}
_Ret _Ret
...@@ -692,7 +703,8 @@ namespace std ...@@ -692,7 +703,8 @@ namespace std
class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret> class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
{ {
public: public:
explicit const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const) explicit
const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const)
: _M_f(__pf) {} : _M_f(__pf) {}
_Ret _Ret
...@@ -707,7 +719,8 @@ namespace std ...@@ -707,7 +719,8 @@ namespace std
class mem_fun_t<void, _Tp> : public unary_function<_Tp*, void> class mem_fun_t<void, _Tp> : public unary_function<_Tp*, void>
{ {
public: public:
explicit mem_fun_t(void (_Tp::*__pf)()) explicit
mem_fun_t(void (_Tp::*__pf)())
: _M_f(__pf) {} : _M_f(__pf) {}
void void
...@@ -722,7 +735,8 @@ namespace std ...@@ -722,7 +735,8 @@ namespace std
class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*, void> class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*, void>
{ {
public: public:
explicit const_mem_fun_t(void (_Tp::*__pf)() const) explicit
const_mem_fun_t(void (_Tp::*__pf)() const)
: _M_f(__pf) {} : _M_f(__pf) {}
void void
...@@ -737,7 +751,8 @@ namespace std ...@@ -737,7 +751,8 @@ namespace std
class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp, void> class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp, void>
{ {
public: public:
explicit mem_fun_ref_t(void (_Tp::*__pf)()) explicit
mem_fun_ref_t(void (_Tp::*__pf)())
: _M_f(__pf) {} : _M_f(__pf) {}
void void
...@@ -752,7 +767,8 @@ namespace std ...@@ -752,7 +767,8 @@ namespace std
class const_mem_fun_ref_t<void, _Tp> : public unary_function<_Tp, void> class const_mem_fun_ref_t<void, _Tp> : public unary_function<_Tp, void>
{ {
public: public:
explicit const_mem_fun_ref_t(void (_Tp::*__pf)() const) explicit
const_mem_fun_ref_t(void (_Tp::*__pf)() const)
: _M_f(__pf) {} : _M_f(__pf) {}
void void
...@@ -767,7 +783,8 @@ namespace std ...@@ -767,7 +783,8 @@ namespace std
class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*, _Arg, void> class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*, _Arg, void>
{ {
public: public:
explicit mem_fun1_t(void (_Tp::*__pf)(_Arg)) explicit
mem_fun1_t(void (_Tp::*__pf)(_Arg))
: _M_f(__pf) {} : _M_f(__pf) {}
void void
...@@ -783,7 +800,8 @@ namespace std ...@@ -783,7 +800,8 @@ namespace std
: public binary_function<const _Tp*, _Arg, void> : public binary_function<const _Tp*, _Arg, void>
{ {
public: public:
explicit const_mem_fun1_t(void (_Tp::*__pf)(_Arg) const) explicit
const_mem_fun1_t(void (_Tp::*__pf)(_Arg) const)
: _M_f(__pf) {} : _M_f(__pf) {}
void void
...@@ -799,7 +817,8 @@ namespace std ...@@ -799,7 +817,8 @@ namespace std
: public binary_function<_Tp, _Arg, void> : public binary_function<_Tp, _Arg, void>
{ {
public: public:
explicit mem_fun1_ref_t(void (_Tp::*__pf)(_Arg)) explicit
mem_fun1_ref_t(void (_Tp::*__pf)(_Arg))
: _M_f(__pf) {} : _M_f(__pf) {}
void void
...@@ -815,7 +834,8 @@ namespace std ...@@ -815,7 +834,8 @@ namespace std
: public binary_function<_Tp, _Arg, void> : public binary_function<_Tp, _Arg, void>
{ {
public: public:
explicit const_mem_fun1_ref_t(void (_Tp::*__pf)(_Arg) const) explicit
const_mem_fun1_ref_t(void (_Tp::*__pf)(_Arg) const)
: _M_f(__pf) {} : _M_f(__pf) {}
void void
......
...@@ -144,7 +144,8 @@ namespace __gnu_norm ...@@ -144,7 +144,8 @@ namespace __gnu_norm
multiset() multiset()
: _M_t(_Compare(), allocator_type()) { } : _M_t(_Compare(), allocator_type()) { }
explicit multiset(const _Compare& __comp, explicit
multiset(const _Compare& __comp,
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { } : _M_t(__comp, __a) { }
......
// Queue implementation -*- C++ -*- // Queue implementation -*- C++ -*-
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -149,11 +149,13 @@ namespace std ...@@ -149,11 +149,13 @@ namespace std
* Returns true if the %queue is empty. * Returns true if the %queue is empty.
*/ */
bool bool
empty() const { return c.empty(); } empty() const
{ return c.empty(); }
/** Returns the number of elements in the %queue. */ /** Returns the number of elements in the %queue. */
size_type size_type
size() const { return c.size(); } size() const
{ return c.size(); }
/** /**
* Returns a read/write reference to the data at the first * Returns a read/write reference to the data at the first
...@@ -209,7 +211,8 @@ namespace std ...@@ -209,7 +211,8 @@ namespace std
* underlying sequence. * underlying sequence.
*/ */
void void
push(const value_type& __x) { c.push_back(__x); } push(const value_type& __x)
{ c.push_back(__x); }
/** /**
* @brief Removes first element. * @brief Removes first element.
...@@ -293,7 +296,6 @@ namespace std ...@@ -293,7 +296,6 @@ namespace std
const queue<_Tp,_Sequence>& __y) const queue<_Tp,_Sequence>& __y)
{ return !(__x < __y); } { return !(__x < __y); }
/** /**
* @brief A standard container automatically sorting its contents. * @brief A standard container automatically sorting its contents.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment