boost::bind used with boost shared_ptr

Hi,
I've recently been making more use of boost::bind, and I coded the
following, which I thought would work:
class A {
public:
void reset () {}
};
typedef std::map

Kevin Ludwig:
Hi,
I've recently been making more use of boost::bind, and I coded the following, which I thought would work:
class A { public: void reset () {} }; typedef std::map
map_type; map_type m; std::for_each (m.begin(), m.end(), boost::bind(&A::reset, boost::bind(&map_type::value_type::second, _1))); but fails to compile.
This compiles for me with MSVC 7.1. What compiler and Boost version do you use? What errors do you get?

Hi,
This is with RHEL, gcc version 3.4.6. I *think* the boost version is 1.32.0.
-bash-3.00$ gcc -v
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-java-awt=gtk
--host=i386-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-8)
-bash-3.00$
The complete mini program I use is:
[code]
#include <map>
#include
Kevin Ludwig:
Hi,
I've recently been making more use of boost::bind, and I coded the following, which I thought would work:
class A { public: void reset () {} }; typedef std::map
map_type; map_type m; std::for_each (m.begin(), m.end(), boost::bind(&A::reset, boost::bind(&map_type::value_type::second, _1))); but fails to compile.
This compiles for me with MSVC 7.1. What compiler and Boost version do you use? What errors do you get? _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Kevin

Kevin Ludwig:
Hi,
This is with RHEL, gcc version 3.4.6. I *think* the boost version is 1.32.0.
1.32 is ancient history. :-) It works for me with g++ 3.4.4 and Boost 1.38.
Anyway, since it works on VC7.1 I imagine that it was fixed in some later version of the library.
Looks like it was fixed in https://svn.boost.org/trac/boost/changeset/31128 which was first released in... Boost 1.33.1, I guess.
participants (2)
-
Kevin Ludwig
-
Peter Dimov