Would be nice to just have this_return_value as a first-class construct in functions, as Pascal has supported all along.
-
-
Prikaži ovu nitHvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
Not bad, though you have to add that constructor to every type you want to init this way. C++17 has guaranteed copy elision, so this trick isn't really needed anymore.
-
Let's say you want to construct an optional<tuple<ts...>> from a tuple<us...>, performing some sort of conversion and test on each element, with the optional's has_value true only if all tests succeed. How would you do this without exceptions or extra copies?
- Još 8 drugih odgovora
Novi razgovor -
-
-
What exactly is the problem youre trying to solve here? You want the address of the object in the calling stack frame i.e. the final destination after copy elision / RVO? I'm not seeing how elision/RVO is guaranteed to happen
-
Aim: testing and transforming data on arbitrary nested data structures in a single pass, generating results once in-place, without throwing exceptions.
Kraj razgovora
Novi razgovor -
-
-
Is the return statement in the constructor supposed to be there? I thought it wasn't valid in C++ to return a value in a constructor.
-
You’re right. “return lambda(this);” should be “lambda(this);”
Kraj razgovora
Novi razgovor -
-
-
*cries into a Stroustroup book*
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
Rewrite it in rust.
-
brb *looks for Michael Jackson eating popcorn meme*
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.