vs... doing a auto x = unique.. auto raw = x.get() return raw->future_foo().then([x = std::move(x)]{}); how to find the spec if unique underlying pointers are invalidated.
c++ twitter: are the pointers inside a unique_ptr<> invalidated on a std::move. Trying to see if bug. Imagine this. auto x = unique_ptr.. return x->future_foo().then([x = std::move(x)]{}); all trivially constructible types have type cast for std::move, so it might be fine...
-
-
Prikaži ovu nitHvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
the problem is that the lambda is evaluated first, believe it or not
-
I agree. and i usually write the raw->foo(); but *somehow* i was about to check a fix but the code seems to work under a debugger and release builds too. and then ... i looked in libcxxpic.twitter.com/zR7EAsF5Dg
- Još 2 druga odgovora
Novi razgovor -
-
-
unique_ptr branches around the pointer value to skip the deleter when the pointer is null. If this wasn't the case you'd have two unique_ptr both trying to delete the same thing. Consequently std::move has to zero out the moved-from value.
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
Č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.