diff options
Diffstat (limited to 'libformat/libformat/format.cxx')
-rw-r--r-- | libformat/libformat/format.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/libformat/libformat/format.cxx b/libformat/libformat/format.cxx index 53530a8..d1c18bc 100644 --- a/libformat/libformat/format.cxx +++ b/libformat/libformat/format.cxx @@ -14,17 +14,16 @@ namespace format { string r (g); - auto tr = [&r] (char (*t) (char)) - { - transform (r.begin (), r.end (), r.begin (), t); - }; - - switch (v) - { - case volume::quiet: tr ([](char c) -> char {return tolower (c);}); break; - case volume::normal: break; - case volume::loud: tr ([](char c) -> char {return toupper (c);}); break; - } + transform (r.begin (), r.end (), r.begin (), + [v] (char c) -> char + { + switch (v) + { + case volume::quiet: return tolower (c); + case volume::normal: return c; + case volume::loud: return toupper (c); + } + }); return r += ", " + n + '!'; } |