|
Boost : |
From: sgregory_at_[hidden]
Date: 2001-11-13 13:50:49
--- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> From: <sgregory_at_c...>
> > Is is ok that AddTick takes a 'const double' ?
>
> It's an MSVC 6 problem; you're right, it doesn't like the 'const'.
MSVC 7 et
> al compile the code.
Grump.
Looks like Sun C++ doesn't like it either, however...
The file below - that Peter make working :-) when fed to a Sun
CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-02 2001/09/18
gives a bunch of errors, which I have attached below if anybody is
interested.
Guess I'll have to give up getting this to work cross-platform for
the time being. *dratt*
"boost_1_25_0/boost/bind.hpp", line 731: Error: inner is not a member
of boost::_bi::_avt_0<2>.
"boost_1_25_0/boost/bind.hpp", line 746: Where: While
specializing "boost::_bi::add_value<Axis*>".
"boost_1_25_0/boost/bind.hpp", line 746: Where: Specialized in
boost::_bi::list_av_2<Axis*, boost::_bi::arg<1>>.
"c.cpp", line 16: Where: Specialized in non-template code.
"boost_1_25_0/boost/bind.hpp", line 731: Error: No parameters
provided for template.
"boost_1_25_0/boost/bind.hpp", line 746: Where: While
specializing "boost::_bi::add_value<Axis*>".
"boost_1_25_0/boost/bind.hpp", line 746: Where: Specialized in
boost::_bi::list_av_2<Axis*, boost::_bi::arg<1>>.
"c.cpp", line 16: Where: Specialized in non-template code.
"boost_1_25_0/boost/bind.hpp", line 731: Error: Redefining
boost::_bi::type<boost::_bi::T> after use in
boost::_bi::add_value<Axis*>.
"boost_1_25_0/boost/bind.hpp", line 746: Where: While
specializing "boost::_bi::add_value<Axis*>".
"boost_1_25_0/boost/bind.hpp", line 746: Where: Specialized in
boost::_bi::list_av_2<Axis*, boost::_bi::arg<1>>.
"c.cpp", line 16: Where: Specialized in non-template code.
> --
> Peter Dimov
> Multi Media Ltd.
>
> #include <boost/bind.hpp>
>
> #include <algorithm>
> #include <list>
>
> class Axis
> {
> public:
> bool AddTick(const double);
> };
>
> int main()
> {
> Axis a;
> std::list<double> l;
> std::for_each(l.begin(), l.end(), boost::bind( &Axis::AddTick, &a,
_1 ) );
> }
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk