|
Boost Users : |
From: Michael Nicolella (boost_at_[hidden])
Date: 2006-07-30 02:05:34
Having trouble compiling this code. Only tested in VC8:
Removing 'const' from only the static class function seems to allow it to
compile. Below is the error messages...
#include <boost/bind.hpp>
#include <boost/function.hpp>
struct A
{
static void foo( const int )
{
}
};
void bar( const int )
{
}
int main()
{
boost::bind( &A::foo, _1 ) ;
boost::bind( &bar, _1 ) ;
}
-------------
1>------ Rebuild All started: Project: test_vc8, Configuration: Debug Win32
------
1>Deleting intermediate and output files for project 'test_vc8',
configuration 'Debug|Win32'
1>Compiling...
1>main6.cpp
1>c:\projects\test_vc8\test_vc8\main6.cpp(17) : error C2665: 'boost::bind' :
none of the 2 overloads could convert all the argument types
1> c:\projects\boost\boost\bind.hpp(1400): could be
'boost::_bi::bind_t<R,F,L> boost::bind<void(*)(int),boost::arg<I>>(F,A1)'
1> with
1> [
1> R=boost::_bi::unspecified,
1> F=void (*)(int),
1> L=boost::_bi::list1<boost::arg<1>>,
1> I=1,
1> A1=boost::arg<1>
1> ]
1> c:\projects\boost\boost\bind\bind_cc.hpp(26): or
'boost::_bi::bind_t<R,F,L> boost::bind<void,int,boost::arg<I>>(R
(*)(B1),A1)'
1> with
1> [
1> R=void,
1> F=void (*)(int),
1> L=boost::_bi::list1<boost::arg<1>>,
1> I=1,
1> B1=int,
1> A1=boost::arg<1>
1> ]
1> while trying to match the argument list '(void (*)(const int),
boost::arg<I>)'
1> with
1> [
1> I=1
1> ]
1>Build log was saved at
"file://c:\projects\test_vc8\test_vc8\Debug\BuildLog.htm"
1>test_vc8 - 1 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
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