This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15998] typo for std::mem_fun1 in include file stl_function.h


------- Additional Comments From pcarlini at suse dot de  2004-06-15 13:19 -------
Not a bug: mem_fun1 (at variance with mem_fun1_t, for instance) is not part
of the ISO Standard and has been moved to the <ext/functional> header inside
the __gnu_cxx namespace. Indeed, the below compiles for me. Thanks.

///////////

#include <functional>
#include <algorithm>
#include <vector>

#include <ext/functional>

class Apple
{
public:
  void Aggregate(int);
};

void foo(const std::vector<Apple*>& apples)
{
  int n = 5;
  std::for_each(apples.begin(), apples.end(), 
		std::bind2nd(__gnu_cxx::mem_fun1<void,
			     Apple, int>(&Apple::Aggregate), 5));
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15998


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]