Hi,
The following test generates an error :
class Position
{
const float & GetX() const {...}
float & GetX() {...}
};
Position myPos;
bind( &Position::GetX, ref(myPos) ) // <- does not compile
How can I avoid these ? : (with MSVC 7.1)
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<10,boost::lambda::function_action<10,Result>>,detail::bin
d_tuple_mapper<const Arg1,const Arg2,const Arg3,const Arg4,const
Arg5,const Arg6,const Arg7,const Arg8,const Arg9,const Arg10>::type>>
boost::lambda::bind(const Arg1 &,const Arg2 &,const Arg3 &,const Arg4
&,const Arg5 &,const Arg6 &,const Arg7 &,const Arg8 &,const Arg9 &,const
Arg10 &)' : expects 10 arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(1743) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<Arity,Act>,detail::bind_tuple_mapper<const Arg1,const
Arg2,const Arg3,const Arg4,const Arg5,const Arg6,const Arg7,const
Arg8,const Arg9,const Arg10>::type>> boost::lambda::bind(const Arg1
&,const Arg2 &,const Arg3 &,const Arg4 &,const Arg5 &,const Arg6 &,const
Arg7 &,const Arg8 &,const Arg9 &,const Arg10 &)' : expects 10 arguments
- 2 provided
with
[
Arity=10,
Act=boost::lambda::function_action<10>
]
..\..\boost\lambda\detail\bind_functions.hpp(1710) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<10,boost::lambda::function_action<10,Result>>,detail::bin
d_tuple_mapper<Result(__cdecl
&)(Par1,Par2,Par3,Par4,Par5,Par6,Par7,Par8,Par9),const Arg2,const
Arg3,const Arg4,const Arg5,const Arg6,const Arg7,const Arg8,const
Arg9,const Arg10>::type>> boost::lambda::bind(Result (__cdecl
&)(Par1,Par2,Par3,Par4,Par5,Par6,Par7,Par8,Par9),const Arg2 &,const Arg3
&,const Arg4 &,const Arg5 &,const Arg6 &,const Arg7 &,const Arg8 &,const
Arg9 &,const Arg10 &)' : expects 10 arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(1673) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<9,boost::lambda::function_action<9,Result>>,detail::bind_
tuple_mapper<const Arg1,const Arg2,const Arg3,const Arg4,const
Arg5,const Arg6,const Arg7,const Arg8,const Arg9>::type>>
boost::lambda::bind(const Arg1 &,const Arg2 &,const Arg3 &,const Arg4
&,const Arg5 &,const Arg6 &,const Arg7 &,const Arg8 &,const Arg9 &)' :
expects 9 arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(1526) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<Arity,Act>,detail::bind_tuple_mapper<const Arg1,const
Arg2,const Arg3,const Arg4,const Arg5,const Arg6,const Arg7,const
Arg8,const Arg9>::type>> boost::lambda::bind(const Arg1 &,const Arg2
&,const Arg3 &,const Arg4 &,const Arg5 &,const Arg6 &,const Arg7 &,const
Arg8 &,const Arg9 &)' : expects 9 arguments - 2 provided
with
[
Arity=9,
Act=boost::lambda::function_action<9>
]
..\..\boost\lambda\detail\bind_functions.hpp(1494) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<9,boost::lambda::function_action<9,Result>>,detail::bind_
tuple_mapper<Result(__cdecl
&)(Par1,Par2,Par3,Par4,Par5,Par6,Par7,Par8),const Arg2,const Arg3,const
Arg4,const Arg5,const Arg6,const Arg7,const Arg8,const Arg9>::type>>
boost::lambda::bind(Result (__cdecl
&)(Par1,Par2,Par3,Par4,Par5,Par6,Par7,Par8),const Arg2 &,const Arg3
&,const Arg4 &,const Arg5 &,const Arg6 &,const Arg7 &,const Arg8 &,const
Arg9 &)' : expects 9 arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(1458) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<8,boost::lambda::function_action<8,Result>>,detail::bind_
tuple_mapper<const Arg1,const Arg2,const Arg3,const Arg4,const
Arg5,const Arg6,const Arg7,const Arg8>::type>> boost::lambda::bind(const
Arg1 &,const Arg2 &,const Arg3 &,const Arg4 &,const Arg5 &,const Arg6
&,const Arg7 &,const Arg8 &)' : expects 8 arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(1322) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<Arity,Act>,detail::bind_tuple_mapper<const Arg1,const
Arg2,const Arg3,const Arg4,const Arg5,const Arg6,const Arg7,const
Arg8>::type>> boost::lambda::bind(const Arg1 &,const Arg2 &,const Arg3
&,const Arg4 &,const Arg5 &,const Arg6 &,const Arg7 &,const Arg8 &)' :
expects 8 arguments - 2 provided
with
[
Arity=8,
Act=boost::lambda::function_action<8>
]
..\..\boost\lambda\detail\bind_functions.hpp(1291) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<8,boost::lambda::function_action<8,Result>>,detail::bind_
tuple_mapper<Result(__cdecl &)(Par1,Par2,Par3,Par4,Par5,Par6,Par7),const
Arg2,const Arg3,const Arg4,const Arg5,const Arg6,const Arg7,const
Arg8>::type>> boost::lambda::bind(Result (__cdecl
&)(Par1,Par2,Par3,Par4,Par5,Par6,Par7),const Arg2 &,const Arg3 &,const
Arg4 &,const Arg5 &,const Arg6 &,const Arg7 &,const Arg8 &)' : expects 8
arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(1257) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<7,boost::lambda::function_action<7,Result>>,detail::bind_
tuple_mapper<const Arg1,const Arg2,const Arg3,const Arg4,const
Arg5,const Arg6,const Arg7>::type>> boost::lambda::bind(const Arg1
&,const Arg2 &,const Arg3 &,const Arg4 &,const Arg5 &,const Arg6 &,const
Arg7 &)' : expects 7 arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(1123) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<Arity,Act>,detail::bind_tuple_mapper<const Arg1,const
Arg2,const Arg3,const Arg4,const Arg5,const Arg6,const Arg7>::type>>
boost::lambda::bind(const Arg1 &,const Arg2 &,const Arg3 &,const Arg4
&,const Arg5 &,const Arg6 &,const Arg7 &)' : expects 7 arguments - 2
provided
with
[
Arity=7,
Act=boost::lambda::function_action<7>
]
..\..\boost\lambda\detail\bind_functions.hpp(1092) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<7,boost::lambda::function_action<7,Result>>,detail::bind_
tuple_mapper<Result(__cdecl &)(Par1,Par2,Par3,Par4,Par5,Par6),const
Arg2,const Arg3,const Arg4,const Arg5,const Arg6,const Arg7>::type>>
boost::lambda::bind(Result (__cdecl
&)(Par1,Par2,Par3,Par4,Par5,Par6),const Arg2 &,const Arg3 &,const Arg4
&,const Arg5 &,const Arg6 &,const Arg7 &)' : expects 7 arguments - 2
provided
..\..\boost\lambda\detail\bind_functions.hpp(1058) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<6,boost::lambda::function_action<6,Result>>,detail::bind_
tuple_mapper<const Arg1,const Arg2,const Arg3,const Arg4,const
Arg5,const Arg6>::type>> boost::lambda::bind(const Arg1 &,const Arg2
&,const Arg3 &,const Arg4 &,const Arg5 &,const Arg6 &)' : expects 6
arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(927) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<Arity,Act>,detail::bind_tuple_mapper<const Arg1,const
Arg2,const Arg3,const Arg4,const Arg5,const Arg6>::type>>
boost::lambda::bind(const Arg1 &,const Arg2 &,const Arg3 &,const Arg4
&,const Arg5 &,const Arg6 &)' : expects 6 arguments - 2 provided
with
[
Arity=6,
Act=boost::lambda::function_action<6>
]
..\..\boost\lambda\detail\bind_functions.hpp(899) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<6,boost::lambda::function_action<6,Result>>,detail::bind_
tuple_mapper<Result(__cdecl &)(Par1,Par2,Par3,Par4,Par5),const
Arg2,const Arg3,const Arg4,const Arg5,const Arg6>::type>>
boost::lambda::bind(Result (__cdecl &)(Par1,Par2,Par3,Par4,Par5),const
Arg2 &,const Arg3 &,const Arg4 &,const Arg5 &,const Arg6 &)' : expects 6
arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(867) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<5,boost::lambda::function_action<5,Result>>,detail::bind_
tuple_mapper<const Arg1,const Arg2,const Arg3,const Arg4,const
Arg5>::type>> boost::lambda::bind(const Arg1 &,const Arg2 &,const Arg3
&,const Arg4 &,const Arg5 &)' : expects 5 arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(738) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<Arity,Act>,detail::bind_tuple_mapper<const Arg1,const
Arg2,const Arg3,const Arg4,const Arg5>::type>> boost::lambda::bind(const
Arg1 &,const Arg2 &,const Arg3 &,const Arg4 &,const Arg5 &)' : expects 5
arguments - 2 provided
with
[
Arity=5,
Act=boost::lambda::function_action<5>
]
..\..\boost\lambda\detail\bind_functions.hpp(710) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<5,boost::lambda::function_action<5,Result>>,detail::bind_
tuple_mapper<Result(__cdecl &)(Par1,Par2,Par3,Par4),const Arg2,const
Arg3,const Arg4,const Arg5>::type>> boost::lambda::bind(Result (__cdecl
&)(Par1,Par2,Par3,Par4),const Arg2 &,const Arg3 &,const Arg4 &,const
Arg5 &)' : expects 5 arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(679) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<4,boost::lambda::function_action<4,Result>>,detail::bind_
tuple_mapper<const Arg1,const Arg2,const Arg3,const Arg4>::type>>
boost::lambda::bind(const Arg1 &,const Arg2 &,const Arg3 &,const Arg4
&)' : expects 4 arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(558) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<Arity,Act>,detail::bind_tuple_mapper<const Arg1,const
Arg2,const Arg3,const Arg4>::type>> boost::lambda::bind(const Arg1
&,const Arg2 &,const Arg3 &,const Arg4 &)' : expects 4 arguments - 2
provided
with
[
Arity=4,
Act=boost::lambda::function_action<4>
]
..\..\boost\lambda\detail\bind_functions.hpp(532) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<4,boost::lambda::function_action<4,Result>>,detail::bind_
tuple_mapper<Result(__cdecl &)(Par1,Par2,Par3),const Arg2,const
Arg3,const Arg4>::type>> boost::lambda::bind(Result (__cdecl
&)(Par1,Par2,Par3),const Arg2 &,const Arg3 &,const Arg4 &)' : expects 4
arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(503) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<3,boost::lambda::function_action<3,Result>>,detail::bind_
tuple_mapper<const Arg1,const Arg2,const Arg3>::type>>
boost::lambda::bind(const Arg1 &,const Arg2 &,const Arg3 &)' : expects 3
arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(387) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<Arity,Act>,detail::bind_tuple_mapper<const Arg1,const
Arg2,const Arg3>::type>> boost::lambda::bind(const Arg1 &,const Arg2
&,const Arg3 &)' : expects 3 arguments - 2 provided
with
[
Arity=3,
Act=boost::lambda::function_action<3>
]
..\..\boost\lambda\detail\bind_functions.hpp(361) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<3,boost::lambda::function_action<3,Result>>,detail::bind_
tuple_mapper<Result(__cdecl &)(Par1,Par2),const Arg2,const Arg3>::type>>
boost::lambda::bind(Result (__cdecl &)(Par1,Par2),const Arg2 &,const
Arg3 &)' : expects 3 arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(333) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2784: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<2,boost::lambda::function_action<2,Result>>,detail::bind_
tuple_mapper<const Arg1,const Arg2>::type>> boost::lambda::bind(const
Arg1 &,const Arg2 &)' : could not deduce template argument for
'overloaded function type' from 'overloaded function type'
..\..\boost\lambda\detail\bind_functions.hpp(232) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2784: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<2,boost::lambda::function_action<2,Result>>,detail::bind_
tuple_mapper<const Arg1,const Arg2>::type>> boost::lambda::bind(const
Arg1 &,const Arg2 &)' : could not deduce template argument for
'overloaded function type' from 'overloaded function type'
..\..\boost\lambda\detail\bind_functions.hpp(232) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2784: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<2,boost::lambda::function_action<2,Result>>,detail::bind_
tuple_mapper<const Arg1,const Arg2>::type>> boost::lambda::bind(const
Arg1 &,const Arg2 &)' : could not deduce template argument for
'overloaded function type' from 'overloaded function type'
..\..\boost\lambda\detail\bind_functions.hpp(232) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2784: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<Arity,Act>,detail::bind_tuple_mapper<const Arg1,const
Arg2>::type>> boost::lambda::bind(const Arg1 &,const Arg2 &)' : could
not deduce template argument for 'overloaded function type' from
'overloaded function type'
with
[
Arity=2,
Act=boost::lambda::function_action<2>
]
..\..\boost\lambda\detail\bind_functions.hpp(212) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2784: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<Arity,Act>,detail::bind_tuple_mapper<const Arg1,const
Arg2>::type>> boost::lambda::bind(const Arg1 &,const Arg2 &)' : could
not deduce template argument for 'overloaded function type' from
'overloaded function type'
with
[
Arity=2,
Act=boost::lambda::function_action<2>
]
..\..\boost\lambda\detail\bind_functions.hpp(212) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2784: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<Arity,Act>,detail::bind_tuple_mapper<const Arg1,const
Arg2>::type>> boost::lambda::bind(const Arg1 &,const Arg2 &)' : could
not deduce template argument for 'overloaded function type' from
'overloaded function type'
with
[
Arity=2,
Act=boost::lambda::function_action<2>
]
..\..\boost\lambda\detail\bind_functions.hpp(212) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2784: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<2,boost::lambda::function_action<2,Result>>,detail::bind_
tuple_mapper<Result(__cdecl &)(Par1),const Arg2>::type>>
boost::lambda::bind(Result (__cdecl &)(Par1),const Arg2 &)' : could not
deduce template argument for 'overloaded function type' from 'overloaded
function type'
..\..\boost\lambda\detail\bind_functions.hpp(190) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2784: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<2,boost::lambda::function_action<2,Result>>,detail::bind_
tuple_mapper<Result(__cdecl &)(Par1),const Arg2>::type>>
boost::lambda::bind(Result (__cdecl &)(Par1),const Arg2 &)' : could not
deduce template argument for 'overloaded function type' from 'overloaded
function type'
..\..\boost\lambda\detail\bind_functions.hpp(190) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2784: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<2,boost::lambda::function_action<2,Result>>,detail::bind_
tuple_mapper<Result(__cdecl &)(Par1),const Arg2>::type>>
boost::lambda::bind(Result (__cdecl &)(Par1),const Arg2 &)' : could not
deduce template argument for 'overloaded function type' from 'overloaded
function type'
..\..\boost\lambda\detail\bind_functions.hpp(190) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<1,boost::lambda::function_action<1,Result>>,detail::bind_
tuple_mapper<const Arg1>::type>> boost::lambda::bind(const Arg1 &)' :
expects 1 arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(91) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<Arity,Act>,detail::bind_tuple_mapper<const Arg1>::type>>
boost::lambda::bind(const Arg1 &)' : expects 1 arguments - 2 provided
with
[
Arity=1,
Act=boost::lambda::function_action<1>
]
..\..\boost\lambda\detail\bind_functions.hpp(71) : see
declaration of 'boost::lambda::bind'
test.cpp(39) : error C2780: 'const
boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::
lambda::action<1,boost::lambda::function_action<1,Result>>,detail::bind_
tuple_mapper<Result(__cdecl &)(void)>::type>> boost::lambda::bind(Result
(__cdecl &)(void))' : expects 1 arguments - 2 provided
..\..\boost\lambda\detail\bind_functions.hpp(49) : see
declaration of 'boost::lambda::bind'
Thank you.
Jacques Kerner