Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost::bind: compiling error from sample code in book
From: Boost lzw (boostlzw_at_[hidden])
Date: 2009-09-02 14:34:09


Hello Bjorn,

Oops, I made a typo myself. The code in the book is correct.
Thanks.

Robert

2009/9/2 Björn Karlsson <Bjorn.Karlsson_at_[hidden]>

> Hello,
>
> > I am testing the following sample code on page 264 of the book "Beyond
> > the C++ Standard Library" and got an error msg: "result_type' : is not
> > a member of '`global namespace'' from MSVC 2008 Pro compiler. Can
> > anyone point out what is wrong with it? Thanks.
> > std::for_each(m.begin(), m.end(),
> > boost::bind(&print_size(), boost::ref(std::cout), _1));
>
> That should read:
>
> std::for_each(m.begin(), m.end(),
> boost::bind(print_size(), boost::ref(std::cout), _1));
>
> In your code there's an ampersand before print_size() that shouldn't be
> there. Did it really look like that in the book?
>
> Cheers,
> Bjorn Karlsson
> www.skeletonsoftware.net
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net