Hi,
I have code which uses Boost lambda in a template like this:
template<class T>
bool lessThanXY( T& src, T& dest ) {
return (src.getY() < dest.getY());
}
template
void sortXY(T1& list) {
::sort( list.begin(), list.end(), bind(::lessThanXY<T2>, *(_1), *(_2) ) );
}
But when I instantiate the template like this, I get the following
compile error:
class Rect;
typedef list RectList;
void sortXYRectList(RectList& rl) {
sortXYWithThreshold(rl);
}
/usr/include/boost/lambda/detail/lambda_traits.hpp:389: error:
ignoring 'const' qualifiers added to function type 'bool ()(Rect&,
Rect&)const'
gmake[5]: *** [RectUtils.o] Error 1
Can you please tell me how to fix my problem ? I did not use 'const'
anywhere in my template, why I get this error:
error: ignoring 'const' qualifiers added to function type 'bool
()(Rect&, Rect&)const'