summaryrefslogtreecommitdiff
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
parent8edc37e006a27edf2b1a331569327be6a53a4c3c (diff)
Work around what appears to be Clang mis-compilation
-rw-r--r--libformat/libformat/format.cxx21
-rw-r--r--libmformat/libmformat/format.cxx21
2 files changed, 20 insertions, 22 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 + '!';
}
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 + '!';
}