В чем ошибка?
От: DrMom  
Дата: 28.01.13 13:59
Оценка: 1 (1) -1
Всем привет.

Что-то я туплю с простым, как мне казалось, кодом:
#include <string>
#include <functional>
#include <boost/ref.hpp>

typedef boost::reference_wrapper<std::string> RefS;

template <class _Tp>
struct MyEqual : public std::binary_function<_Tp, _Tp, bool> 
{
   bool operator()(const _Tp& __x, const _Tp& __y) const 
   {
      return __x == __y; 
   }
};

int main() 
{
   std::string str;
   RefS ref1(str);
   {
      MyEqual<RefS> eq;
      eq(ref1, ref1);
   }
   {
      std::equal_to<RefS> eq;
//убираю коментарий и получаю ошибку. 
//      eq(ref1, ref1);
   }

   return 0;
}

bool operator==(const RefT& a, const RefT& b)
{
   return a==b;
}


Может кто поможет?
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.