Yep; but a parameter is one of the special "safe" cases where the variable's lifetime is guaranteed to be shorter than the lifetime of its initializing expression. Other "safe" cases are catch-handler "parameters" (not that it makes much sense to catch a string_view) and for-loop "parameters" โ i.e. `for (string_view sv : stuff())`. The most relevant of these cases by far is the case of plain old function parameters.
These are cases where the core language helps the programmer out, and basically makes a whole class of bugs โ well, not impossible, but difficult to run into if you're not actually trying. There are other cases, e.g. `string_view sv = stuff();` as used in TFA, where the core language offers no help at all, but there's an easy solution available. ("Don't do that, then." Treat `string_view` as a "parameter-only type" and you'll never encounter that kind of problem.)
This is why I call string_view a "parameter-only type": it's fine to take as a parameter, but not fine to return or to store as a variable. (For sane definitions of "fine" and "not fine," of course. The blog post demonstrates one way it can go "not fine.")
Not the Flynn effect; just people having fun, and selection bias. I (the blogger) deliberately left out many boring responses, except for linking to the Evening World's letters page of 1903-11-11.[1] I filtered out scores of replies from schoolchildren walking through the algebra to get the correct answer, and dozens of (usually short) replies from people of various ages giving wrong answers with and without reasoning, some almost certainly joking, some almost certainly not. But that's what you should expect from a Letters to the Editor section on any given math meme! Our discourse hasn't changed that much over 120 years. See my other post,[2] linked at the bottom of the current one, on "What is 8รท2(2+2)?" โ that's not as fair a question, but the discourse is pretty much the same in unfiltered Letters-to-the-Editor sections: "I think it's X. Well, I think it's Y."
The whole point of this kind of meme is for the populace to perform disagreement about the answer! (See also: the Monty Hall problem; sports; comments sections.)
These are cases where the core language helps the programmer out, and basically makes a whole class of bugs โ well, not impossible, but difficult to run into if you're not actually trying. There are other cases, e.g. `string_view sv = stuff();` as used in TFA, where the core language offers no help at all, but there's an easy solution available. ("Don't do that, then." Treat `string_view` as a "parameter-only type" and you'll never encounter that kind of problem.)
And then there's C++20 coroutine "parameters," where the core language pretty actively tries to trip you up. https://quuxplusone.github.io/blog/2019/07/10/ways-to-get-da...