Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. void CreateProcess(int, float);
  2.  
  3. int int_param = ...;
  4. float float_param = ...;
  5.  
  6. CreateProcess(0, 0); //Use both defaults
  7. CreateProcess(int_param, 0); //Use default float
  8. CreateProcess(0, float_param); //Use default int
  9. CreateProcess(int_param, float_param); //No defaults
  10.  
  11. CreateProcess( (... ? 0 : int_param), (... ? 0 : float_param) );
  12.  
  13. template<typename ...Args>
  14. explicit child(Args&&...args);
  15.  
  16. int int_param = ...;
  17. float float_param = ...;
  18.  
  19. child c; //Use both defaults
  20. child c(int_param); //Use default float
  21. child c(float_param); //Use default int
  22. child c(int_param, float_param); //No defaults
  23. child c(float_param, int_param); //Argument order is irrelevant
  24.  
  25. if (...) {
  26. if (...)
  27. child c;
  28. else
  29. child c(float_param);
  30. } else {
  31. if (...)
  32. child c(int_param);
  33. else
  34. child c(int_param, float_param);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement