Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <boost/parameter.hpp>
- BOOST_PARAMETER_NAME(firstName)
- BOOST_PARAMETER_NAME(lastName)
- BOOST_PARAMETER_NAME(age)
- BOOST_PARAMETER_NAME(email)
- BOOST_PARAMETER_FUNCTION(
- (void),
- displayPerson,
- tag,
- (optional
- (email, (std::string), "No email provided")
- )
- (deduced
- (required
- (firstName, (std::string))
- (lastName, (std::string))
- (age, *)
- )
- )
- )
- {
- std::cout << "First name: "<< firstName << '\n';
- std::cout << "Last name: "<< lastName << '\n';
- std::cout << "Age: "<< age << '\n';
- std::cout << "Email: "<< email << '\n';
- }
- int main()
- {
- displayPerson(_age = "forty-two", _lastName = "Doe", _firstName = "John");
- }
Add Comment
Please, Sign In to add comment