In function:
void clean_data (MyMap& map)
{
remove_if(map.begin(), map.end(), (&lambda::_1 )->*(&pair< X* const,
double >::second) <= m_epsilon);
}
where:
typedef std::map MyMap;
I get error:
c:\program files\microsoft visual studio
9.0\vc\include\algorithm(1240) : error C2582: 'operator =' function is
unavailable in 'std::pair<_Ty1,_Ty2>'
with
[
_Ty1=const hapl::Haplotype *const ,
_Ty2=double
]
c:\program files\microsoft visual studio
9.0\vc\include\algorithm(4949) : see reference to function template
instantiation '_OutIt
std::_Remove_copy_if::iterator,_OutIt,_Pr>(_InIt,_InIt,_OutIt,_Pr,std::_Range_checked_iterator_tag)'
being compiled
with
[
_OutIt=std::_Tree,std::allocator>,false>>::iterator,
_Traits=std::_Tmap_traits,std::allocator>,false>,
_Pr=boost::lambda::lambda_functorboost::lambda::lessorequal_action,boost::tuples::tupleboost::lambda::member_pointer_action>,boost::tuples::tupleboost::lambda::addressof_action,boost::tuples::tuple>,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>,double
std::pair::* const
,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>,const
double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>,
_InIt=std::_Tree,std::allocator>,false>>::iterator
]
c:\program files\microsoft visual studio
9.0\vc\include\algorithm(1309) : see reference to function template
instantiation '_OutIt
stdext::unchecked_remove_copy_if::iterator,_FwdIt,_Pr>(_InIt,_InIt,_OutIt,_Pr)'
being compiled
with
[
_OutIt=std::_Tree,std::allocator>,false>>::iterator,
_Traits=std::_Tmap_traits,std::allocator>,false>,
_FwdIt=std::_Tree,std::allocator>,false>>::iterator,
_Pr=boost::lambda::lambda_functorboost::lambda::lessorequal_action,boost::tuples::tupleboost::lambda::member_pointer_action>,boost::tuples::tupleboost::lambda::addressof_action,boost::tuples::tuple>,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>,double
std::pair::* const
,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>,const
double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>,
_InIt=std::_Tree,std::allocator>,false>>::iterator
]
c:\users\kott\documents\visual studio
2008\projects\mbi\implementation\src\main.cpp(631) : see reference to
function template instantiation '_FwdIt
std::remove_if::iterator,boost::lambda::lambda_functor<T>>(_FwdIt,_FwdIt,_Pr)'
being compiled
with
[
_FwdIt=std::_Tree,std::allocator>,false>>::iterator,
_Traits=std::_Tmap_traits,std::allocator>,false>,
T=boost::lambda::lambda_functor_baseboost::lambda::lessorequal_action,boost::tuples::tupleboost::lambda::member_pointer_action>,boost::tuples::tupleboost::lambda::addressof_action,boost::tuples::tuple>,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>,double
std::pair::* const
,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>,const
double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>,
_Pr=boost::lambda::lambda_functorboost::lambda::lessorequal_action,boost::tuples::tupleboost::lambda::member_pointer_action>,boost::tuples::tupleboost::lambda::addressof_action,boost::tuples::tuple>,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>,double
std::pair::* const
,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>,const
double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>
]
I don't get it because i found somewhere
(http://www.lukaszczerwinski.pl/boost_lambda_member_access.html)
similar example that (should) work fine:
std::map< std::string , int > someMap;
using boost::lambda::_1;
std::for_each(
someMap.begin(),
someMap.end(),
std::cout
<< ( & _1 ) ->* ( & std::pair< std::string const, int >::first )
<< std::endl
);
--
Michał Nowotka