fork(2) download
  1. #include <vector>
  2. #include <algorithm>
  3. #include <functional>
  4. #include <string>
  5. #include <iostream>
  6. using namespace std;
  7. using std::placeholders::_1;
  8.  
  9. int main() {
  10. std::string v1 = "foo";
  11. std::string v2 = "foo";
  12.  
  13. bool r =
  14. std::bind(
  15. static_cast<bool(*)(const std::string&, const std::string&)>(&std::operator==<char, std::string::traits_type, std::string::allocator_type>),
  16. std::placeholders::_1,
  17. std::cref(v1))(v2);
  18. return 0;
  19. }
Success #stdin #stdout 0s 3224KB
stdin
Standard input is empty
stdout
Standard output is empty