summaryrefslogtreecommitdiff
path: root/libmformat
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-08-24 13:43:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-08-24 13:43:23 +0200
commit865bf2ec13bd36d80147a94bc4d5f52b107c169e (patch)
tree1f91e863248fbdd8f2a3cf2d59df3c62459c206b /libmformat
parent8edc37e006a27edf2b1a331569327be6a53a4c3c (diff)
Work around what appears to be Clang mis-compilation
Diffstat (limited to 'libmformat')
-rw-r--r--libmformat/libmformat/format.cxx21
1 files changed, 10 insertions, 11 deletions
diff --git a/libmformat/libmformat/format.cxx b/libmformat/libmformat/format.cxx
index fe6ad15..181eb86 100644
--- a/libmformat/libmformat/format.cxx
+++ b/libmformat/libmformat/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 + '!';
}