Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // instead of unspecific-typed arguments
- Pizza makePizza(int piperoni_cnt, int jalapeno_cnt);
- // use field-specific type
- Pizza makePizza(Piperoni piperoni, Jalapeno jalapeno);
- int main() {
- auto p = makePizza(3, 1); // huh, what 3? what 1?
- auto p = makePizza(Piperoni{Parts{3}}, // 3 parts of piperoni
- Jalapeno{Parts{1}}); // 1 part of jalapeno (hot!)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement