fine-grained-name-control0.cpp 329 B

123456789101112131415161718192021
  1. #include <boost/parameter.hpp>
  2. BOOST_PARAMETER_NAME((pass_foo, keywords) foo)
  3. BOOST_PARAMETER_FUNCTION(
  4. (int), f, keywords, (required (foo, *))
  5. )
  6. {
  7. return foo + 1;
  8. }
  9. #include <boost/core/lightweight_test.hpp>
  10. int main()
  11. {
  12. int x = f(pass_foo = 41);
  13. BOOST_TEST_EQ(x, 42);
  14. return boost::report_errors();
  15. }