Filter
Exclude
Time range
-
Near
A sleeping pad is not just about comfort. It is part of your insulation system, and the wrong pad can make a good sleeping bag feel like it failed. Do you check R-value before buying one? #CampingGear #RValue #WildernessSkills
1
3
10
1,293
Replying to @schteppe
95% don't even understand what an rvalue is...and it might be moved...so let them believe it
747
std::move creates a "rvalue reference" which gives the recipiant permission (but not obligation) to "move" the source value. In general a "move" in C is expected to leave the source in a "valid but otherwise unspecified" state.
2
12
Replying to @abdimoalim_
Now explain the difference betwen an expiring value and a pure rvalue.
113
What happes to the source is whatever the thing that's doing the move (i.e. the function that accepts an rvalue ref) decides what should happen to it. But the source still exists afterwards, and its destructor eventually runs, so you can't leave it in some indeterminate state.
8
std::move does nothing but convering a lvalue ref to an rvalue ref. Actual moves are not destructive, because the original object still exists.
1
5
128
what can be simplier than C std:move? the deeper i think, the more i think we should restart the c . lvalue/rvalue is obviously a part of type system. its hard to tell what is the right approach. its meta-types? r/l-values diff SHOULD NOT EXIST outside of types, its a hack
22
Replying to @altmind @Arikalabs
Oh, rvalues and lvalues are certainly very distinct. Lvalue references are comparatively simple and very old. Basically const pointers with some syntactic sugar. Rvalue references, on the other hand ... yeah.
2
4
254
oh && is basically a "rvalue", for both in- and out-. what you expect from a function that takes rvalue and returns rvalue. oh its hostile. is rvalue/lvalue really a part of meta-type system. these are diff types. can you expect users to learn 2 type systems, one implicit?
10
accepts ref(or convertable), gives a ref. this language make my head hurt. c never introduced rvalue/lvalue distrinction in the type system? maybe legit. but why the users need to know the typing of something outside of language typing system?
1
1
918
Replying to @0xxNathan
Build you rvalue and you get to attract better oppurtunities
1
1
42
Replying to @CallMeSaintJose
گو نه آکادمیکه و نه اکسپرسیو فقط سادست و پراگماتیک (چه کصی گفتم) آرایه ها توی گو ریفرنس ان درصورت که شبیه rvalue میمونن
260
Replying to @vivekgalatage
The first one. It’s tempting to think that it’s the second because “move” casts to rvalue, but the second function accepts non-cost rvalue, so const ref wins.
4
716
Replying to @vivekgalatage
const int& will be called. If it was const int&& then that would be called first because binding an rvalue to an rvalue reference is a better match
2
535
Replying to @ChShersh
OK, but it won't compile. Post increment returns an rvalue. Post decrement requires an l value. Same with following . The post increment on the name makes sense (or it did for the first few decades).
1
3
160
std::move doesn't move anything, it just casts to an rvalue reference.
9
2
88
18,938
Tips: C言語の規格で rvalue という語は定義されていない
1
9
578
Replying to @cypher0543
Sure, C lets you craft pointer values to write to like a portable assembler. But how did that end up responsible for lvalue references, rvalue references, and universal references? C spec is ~700 pages. C is 2000 . The extra pages didn’t come from C, no?
1
2
205