Containers of reference_wrappers (comparison operators required?)
- by kloffy
If you use stl containers together with reference_wrappers of POD types, the following code works just fine:
int i = 3;
std::vector< boost::reference_wrapper<int> > is;
is.push_back(boost::ref(i));
std::cout << (std::find(is.begin(),is.end(),i)!=is.end()) << std::endl;
However, if you use non-POD types such as (contrived…