Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum level {
- info,
- warning,
- error,
- };
- // Somewhere defined by the programmer.
- constexpr auto MIN_LEVEL = warning;
- template<level lvl>
- void log(arg1, arg2, arg3, etc) {
- if (lvl >= MIN_LEVEL) real_log(arg1, arg2, arg3, etc);
- }
- void real_log(arg1, arg2, arg3, etc) {
- // do some logging
- }
Add Comment
Please, Sign In to add comment