Guest User

Untitled

a guest
Dec 10th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. enum level {
  2. info,
  3. warning,
  4. error,
  5. };
  6.  
  7. // Somewhere defined by the programmer.
  8. constexpr auto MIN_LEVEL = warning;
  9.  
  10. template<level lvl>
  11. void log(arg1, arg2, arg3, etc) {
  12. if (lvl >= MIN_LEVEL) real_log(arg1, arg2, arg3, etc);
  13. }
  14.  
  15. void real_log(arg1, arg2, arg3, etc) {
  16. // do some logging
  17. }
Add Comment
Please, Sign In to add comment