Guest User

Untitled

a guest
Jan 10th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. #include <boost/parameter.hpp>
  5.  
  6. BOOST_PARAMETER_NAME(firstName)
  7. BOOST_PARAMETER_NAME(lastName)
  8. BOOST_PARAMETER_NAME(age)
  9. BOOST_PARAMETER_NAME(email)
  10.  
  11. BOOST_PARAMETER_FUNCTION(
  12. (void),
  13. displayPerson,
  14. tag,
  15. (optional
  16. (email, (std::string), "No email provided")
  17. )
  18. (deduced
  19. (required
  20. (firstName, (std::string))
  21. (lastName, (std::string))
  22. (age, *)
  23. )
  24. )
  25. )
  26. {
  27. std::cout << "First name: "<< firstName << '\n';
  28. std::cout << "Last name: "<< lastName << '\n';
  29. std::cout << "Age: "<< age << '\n';
  30. std::cout << "Email: "<< email << '\n';
  31. }
  32.  
  33. int main()
  34. {
  35. displayPerson(_age = "forty-two", _lastName = "Doe", _firstName = "John");
  36. }
Add Comment
Please, Sign In to add comment