Cześć
Mam problem z funktorem dziedziczącym z std::binary_function.
class RemoveFunctor : public std::binary_function<Component* const, char const * const, bool>
{
result_type operator() (first_argument_type component_p, second_argument_type componentName_p)
{
...
}
};
Otrzymuję następujący error:
Error 1 error C2535: 'bool std::binder2nd<_Fn2>::operator ()(Component *const &) const' : member function already defined or declared c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional 341
Gdy zrobię tak
class RemoveFunctor : public std::binary_function<Component*, char const * const, bool>
to otrzymam
Error 1 error C3848: expression having type 'const Composite::RemoveFunctor' would lose some const-volatile qualifiers in order to call 'bool Composite::operator ()(Component *,const char *const )' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional 342
Funktor ma operować na kontenerze, którego elementami są Component const* . Czy jest fizyczna możliwość, żeby to zadziałało? boost::bind albo nowy std::bind nie wchodzą w grę.
Dzięki z góry!