parameter-enabled-function-call-operators0.cpp 516 B

1234567891011121314151617181920212223242526272829
  1. #include <boost/parameter.hpp>
  2. #include <iostream>
  3. using namespace boost::parameter;
  4. BOOST_PARAMETER_NAME(arg1)
  5. BOOST_PARAMETER_NAME(arg2)
  6. struct callable2
  7. {
  8. BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR(
  9. (void), tag, (required (arg1,(int))(arg2,(int)))
  10. )
  11. {
  12. std::cout << arg1 << ", " << arg2 << std::endl;
  13. }
  14. };
  15. #include <boost/core/lightweight_test.hpp>
  16. int main()
  17. {
  18. callable2 c2;
  19. callable2 const& c2_const = c2;
  20. c2_const(1, 2);
  21. return boost::report_errors();
  22. }