boost-ref

No matching call error occuring for boost::ref but not with std::ref

一世执手 提交于 2019-12-10 13:17:01
问题 I've written some code which counts the number of elements of vector using a functor and the ref and bind templates from boost:: or std:: (for C++11) namespaces. I'm using a #define to switch between boost:: and std:: namespaces. I'm using boost version 1.53 and my compilation command is g++ test.cpp -std=c++11 . I've tried with gcc versions 4.7.2 and 4.6.3 and I get the same errors with both. I have 3 questions: I don't understand the error that is generated for Example 2. Is it possible to