安倍在自民党大会上公开就森友学园“地价门”道歉
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 11, 2014 at 6:23 | comment | added | Nils von Barth |
Thanks! True that string literals could be special-cased, though that would also be a hack, and confusing in its own way: why does "foo" + "bar" work but string s = "bar"; "foo" + s not? I think the reasoning is that string literals are decidedly of type char [] (C)/const char [] (C++). However, it does work in C++14 with the new string standard literal (with s suffix): "foo"s + "bar"s is legit, and subject to folding.
|
|
Jul 10, 2014 at 20:14 | comment | added | deft_code | Great point that constant folding removes all of the advantage. This could even work in C/C++ if limited to only string literals. | |
Jul 10, 2014 at 4:00 | history | answered | Nils von Barth | CC BY-SA 3.0 |