does using result guarantee NRVO (Named Return Value Optimization)?
I could swear I recently saw a post from @Araq mentioning that result in a proc was not just syntax sugar but also guaranteed that the compiler would use NRVO, however I can't find a single trace of it in the forums nor in github nor in nim git repo, so maybe I imagined this?
Side question: is the forum "search" guaranteed to return all results?
Side question: is the forum "search" guaranteed to return all results? (eg: https://forum.nim-lang.org/search?q=NRVO now only returns this thread, not the one I (maybe) saw or maybe imagined...)
Pretty sure it isn't. I can't find old posts that I know are there.
Side question: is the forum "search" guaranteed to return all results? (eg: https://forum.nim-lang.org/search?q=NRVO now only returns this thread, not the one I (maybe) saw or maybe imagined...)
Pretty sure it isn't. I can't find old posts that I know are there.
Indeed. It always returns the first 20 or so results. But if there is only 3 search results shown then that's all the results.
The forum's search was paginated. With the new forum the pagination is gone, now there 0 is hard-coded as the start offset and 40 as the number of results.
If pagination/"get more results" are to be added, the offsets are passed at forum.nim lines 1437-1438, two $0 in /search.json route.
Nim does indeed guarantee that, as far as it is in its realm when targetting C and C++.
can this statement be made more precise? eg:
proc foo(x:int):auto=
if x == 0: return "abc"
result = "bar"
I'm assuming the NRVO guarantee goes away if return is mixed with result, right?