« first day (1682 days earlier)      last day (3270 days later) » 

7:00 PM
@MooingDuck It's just VS being dumb.
 
@FilipRoséen-refp In this case, I think linking to the code probably suffices.
 
@JerryCoffin but including the actual meta-container implementation in the post itself? (75 lines of code)
 
@R.MartinhoFernandes he cast a prvalue to an rvalue, then modified it. Isn't that UB?
 
"he cast a prvalue to an rvalue" makes no sense.
 
you make no sense
 
7:01 PM
Casts are between types, not value categories.
He cast thing* to thing*.
 
const_cast is fine when used on logical constness
 
Hmm.. after some reflection, and considering the facts as can be demonstrated and verified, I think I'll stick to my 'hide under that bathroom sink' plan.
 
Now why is the second this different?
 
@R.MartinhoFernandes ok. "He abused a cast in order to be able to treat a prvalue like an rvalue"?
 
2 mins ago, by R. Martinho Fernandes
@MooingDuck It's just VS being dumb.
@MooingDuck Er, no. The cast is a prvalue.
prvalues are rvalues.
 
7:03 PM
@FilipRoséen-refp Yeah, probably--that doesn't strike me as particularly excessive, and you're clearly not just posting a bunch of code without any explanation, or anything like that either.
 
@MooingDuck None of that makes sense.
 
@R.MartinhoFernandes apparently I need to review prvalues.
 
@R.MartinhoFernandes someone in this room said (this) is const pointer. I apologize for not researching further... (its only const in const funcs)
 
Also, I should add learning to spell apparently without a spellchecker to my to-do list.
 
shit the restaurant's full
I need a plan B for food
 
7:03 PM
@DonLarynx There's no constness.
No one is listening.
 
@JerryCoffin thanks!
 
2 mins ago, by R. Martinho Fernandes
He cast thing* to thing*.
 
@MooingDuck Some extra punctuation would not go amiss :)
 
Can you const_cast<int>(0)++?
 
are you really discussing what I think you are discussing?
 
what the heck Lounge<C++>, come on now..
 
Here's what a proper compiler does.
 
of course one cannot increment the value yield after that cast, how did this even turn into a debate?
 
@MartinJames Also, I should add learning to spell the word "apparently" without a spellchecker to my to-do list.
 
@MooingDuck "He abused a bug in VS to be able to do nonsense"
 
7:06 PM
@LucDanton probably a seg fault
 
@DonLarynx That's a different question. That changes it from T * to T const *. The issue here would be T *const.
 
@FilipRoséen-refp Because there's one major compiler out there that is ridiculous.
 
@FilipRoséen-refp because VS allows it on a this pointer
 
@R.MartinhoFernandes eh, that error message could be better :D
 
@MooingDuck it allows this too int x = 123; static_cast<int> (x)++ if I recall correctly, it has nothing to do with the this pointer
 
7:07 PM
@FilipRoséen-refp That’s what I asked!
 
16 mins ago, by R. Martinho Fernandes
It's not const.
I skipped over that bit lol
 
that particular compiler can also bind temporaries to lvalue-references, fucks up everything it touches, and doesn't even implement even the basic of things properly
 
Mistakenly
 
I feel sad for those who think the behavior shown by vc++ is the correct one. Sure, there are cases where gcc and clang gets it wrong, and vc++ surprisingly gets it right - but those are very very rare
 
use VC as ide and clang as compiler master race
 
7:10 PM
I think feeling sad is a bit exaggerated
 
@FilipRoséen-refp Anybody who bases their understanding of the language on any one implementation deserves pretty much what they get (IMO).
 
@AndyProwl surely, I mean.. I don't mind those who uses it as such, but please don't infect Lounge<C++>!
@JerryCoffin and those who base it on what is written in the standard gets bashed on for doing that.. so it's a narrow road ;-)
 
@FilipRoséen-refp making mistakes and not knowing stuff is normal man
 
@AndyProwl surely, I agree with you one that
 
@FilipRoséen-refp No one did here. They were just trying to understand what happened.
 
7:11 PM
@R.MartinhoFernandes oh, alright - maybe I misunderstood what was going on
I'm dead tired from writing this upcoming blog post, I have just a short few paragraphs left - but I can't focus
need more coffee, but I'm at the uni my girlfriend attends - and there is no coffee in sight
 
@FilipRoséen-refp Some places they might, but I'd certainly hope not here (though I'll admit, I do sometimes get a little irritated when people want to impose "that's undefined behavior" on somebody who's (for example) clearly writing a device driver, and only cares about one compiler on one OS).
 
@JerryCoffin agreed, fully.
 
@Jerry re this, is i = (i = i + 1) + 1; really UB in C++11? The rhs must be evaluated before the lhs no?
 
@AndyProwl rules changed in C++11, not sure if that's still UB
 
it's not undefined if I recall correctly. I will have to check.
 
7:19 PM
@MooingDuck yeah, me neither. 5.18/1 seems to imply it's not but hey today it's suckage day for me so icbw
 
@AndyProwl used to be, because the results would be evaluated correctly, but they sometimes weren't applied to memory in the correct order.
 
this seems to say it's still UB though
I don't understand why
ah no wait
i = ++i + 1 ; //well defined behaviour
 
Aha, I went out for a couple hours. When I came back, my sandals migrated halfway across the room.
My dad sent me one of these: en.wikipedia.org/wiki/Roomba
And it pushed my sandals across the room.
 
just for the record ++i = (i = i + i) is (of course) undefined-behavior since there are no sequence-point between lhs and rhs, the reason i = (i = i + 1) is well-defined is because lhs simply denotes a location to put some value
 
reprogram it
 
7:25 PM
@Mysticial I bet it was a poltrgeist
 
to do tricks and make r2d2 sounds
 
@FilipRoséen-refp yeah but that's not the example we were discussing, is it?
 
@AndyProwl no, but you don't see how the explanation (2nd part of the sentence) applies to what you are discussing?
 
@FilipRoséen-refp oh, I skipped that one when I saw the first part - I thought it was unrelated
so i = (i = i + 1) + 1 is not UB right?
it's the same as i = ++i + 1
 
7:27 PM
while i = i++ + 1 is still UB
 
@FilipRoséen-refp Are you guys discussing C++03 or what lol
 
More or less
 
C++03 rules are a good approximation and are simpler to understand, so whatever.
 
?
no, I don't care about how it worked 12 years ago
 
sequence points
 
7:30 PM
I'm so bad at Hearthstone
 
I am rather good at it!
 
phew agar.io is up again
 
oh no :(
 
lol
 
TMI, dude. I did not need to know that
 
7:32 PM
@AndyProwl I'll start caring once someone will find an example that's UB under the new rules and well-defined under the old.
 
they stopped implementing new features though, that sucks
 
Ell
@BartekBanachewicz just get lucky and you'll win
 
How come i = i + 1 is not undefined behavior? I mean, there is no sequence point between reading from i and writing to i, is there?
 
you don't need the value of i for the lhs
location is enough
 
well, it's a very common thing to do...
 
7:36 PM
@AndyProwl Neither do I need it in i = i++, which is UB...
 
yeah but there you have two unsequenced assignments to i
 
I got up to 550 and then got eaten
 
@thecoshman WTF is short sited code? Code that comes from a short site?
 
stackov.com
 
@AndyProwl Honestly, I'd have to check the standard to be absolutely certain, but my recollection is that it at least wasn't clear that it was defined.
 
7:42 PM
@fredoverflow That's because of the "extra" assignment in the ++.
 
@fredoverflow no, code where you only think about the very immediate needs. Never thinking how it can be reused, how if you put just a little bit more time and effort in now, you can avoid errors building up.
 
think of it as being two statements, i = i + 1; and i = i;- the UB comes from the fact that the two statements are not ordered.
 
@thecoshman That's short-sighted...
 
Ell
I forgot why i = i++ should be UB.
 
I literally just explained it.
 
7:44 PM
6 mins ago, by Andy Prowl
yeah but there you have two unsequenced assignments to i
 
@Ell We will never truly know.
 
Ell
@Puppy oh yeah
I saw a i;- and thought you were talking about something else
idk why :L
 
because you're brainless and not a genius puppy?
 
Ell
puppies are dumb
 
puppies are smart beings
they can learn to stop shitting on the floor way faster than babies
 
Ell
7:46 PM
prolly not relative to their life span
 
hmm
interesting question I guess
I admittedly did not measure this.
 
HMm, my VS2013 toolbar is messed up. The step/stop/start/restart buttons on the toolbar are always greyed out, and so I have to go into the menu to stop/restart.
 
usually means that you're not attached properly
 
Not sure how that could be. I press F5 and it launches my program.
 
@thecoshman Isn't thinking only about the immediate needs one of the corner stones of Agile?
YAGNI?
 
7:49 PM
@Ell because the assignment's side effect which is the write to the left lvalue, happens after the evaluation of both left and right expressions. However there are no guarantees that the assignment's side effects will happen after the subexpressions' side effects which is the increment of i. It works with i = ++i + 1, because the evaluation of ++i is guaranteed to happen after the side effect.
 
you can start without debugging
i.e., start the program without attaching.
 
@fredoverflow sadly yes.
 
if you messed up your shortcuts it could be launching without attaching
@fredoverflow I'd say it's more like being able to do that.
 
@Puppy So UB in these ++ scenarios always comes from two assignments? But then why is i++ + i UB? :) It seems there is no easy way to explain it.
 
@Puppy but the breakpoints all work and I can step through. And the menu options all work fine, its only the toolbar buttons that are disabled
 
7:50 PM
@fredoverflow there is a difference between YAGNI and "this is pure shite, but it works, so fuck it worrying about it ever going wrong, some other poor sap can fix that up, and god help him if they need to test anything, because I sure as hell ain't going to worry about that, I've got a feature to deliver"
 
@fredoverflow Just make the second statement a pointless i;. It doesn't have to be an assignment, just an unsequenced extra thing that has to happen.
 
@thecoshman If you can't test it, it's definitely not agile.
 
@fredoverflow modification to left-hand i is not sequenced with evaluation of the right-hand i
 
@fredoverflow the quickest short term solution is manual demo and call that tested and say job done. Thinking about more than this sprint means you have an automated test in place to make sure what was working once is working forever more.
 
Is it possible to detect all UBs at compile-time, modulo aliasing?
@thecoshman When I say "test", I mean "JUnit" ;)
 
7:53 PM
btw @fred this might help
 
@fredoverflow Isn't that the halting problem?
 
@fredoverflow if that's all you mean, please learn to test sufficently.
 
> Evaluations can be one of two things: value computations, which work out the result of an expression; and side effects, which are modifications of objects.
IME, beginners have a very hard time understanding this difference.
 
yeah
that's also why there are 2025409258 questions on SO about i++ + ++i
and it's not only beginners who get confused
 
The most obvious symptom is "Why would I want to call a function that returns void"?
 
7:56 PM
@fredoverflow If you put in constexpr function :P
and evaluate it at compile time.
 
> For the purposes of determining undefined behavior, we also need to identify any value computations that use the value of an object. This is quite a subtle point, but only value computations of expressions denoting objects (like i) that are being used where an rvalue is expected are value computations that use the value of an object. When such an expression is used where an lvalue is expected instead, its value is not important, as in the left operand of =.
I am dreading to teach this stuff, should I ever become the next Scott Meyers or something :)
i = ++i
> Before C++11, this was actually considered undefined, despite having only one possible result.
Is that so? Is there only one possible result in C++03?
 
@fredoverflow logically and syntactically. But the processor may assign the wrong thing anyway.
 
yeah
 
I just realized. In MGR, you have this weapon called the Polearm. It's a pole made with arms.
 
Ell
8:16 PM
lol
 
@EtiennedeMartel Would armpole make more sense?
 
@MarcoA. whoa
 
user1804599
Hello, world!
 
Ven
hi!
 
Ell
8:19 PM
nice
 
Wasn't that on reddit the other day?
 
user1804599
What other day?
 
user1804599
There are many days that aren't this one.
 
user1804599
Fun-fact: most numbers don't equal 1.
 
8:21 PM
@fredoverflow yes, found there
 
In that case, I revoke your Doctor's degree.
 
I like how the scroll bars are not perspective distorted :v
 
no, no, NO
7
 
follow the standard and try to interpret it right >: (
 
user1804599
8:23 PM
I have no scrollbars.
 
user1804599
Well, I do while scrolling.
 
user1804599
And they work just fine with the 3D effect.
 
@MarcoA. Why does this get starred? It was already posted earlier.
Tsk tsk.
 
user1804599
@Ven Perl is good.
 
Ven
@rightfold I never said anything about perl not being good :-)
 
8:26 PM
@EtiennedeMartel no idea, wasn't here before
 
user1804599
I did.
 
readability at its best
 
@MarcoA. It's a joke, if you don't know.
It's subtle.
 
yes, I do know. But I liked to play it a bit longer
not really compatible anywhere, to be honest
but a nice one though
 
8:36 PM
uh sorry for re-posting, I completely missed it before
 
@buttifulbuttefly Nope. operator[] was actually not my thing. Someone's PR.
 
Every once in a while I encounter silly Qt "features": doc.qt.io/qt-5/qtglobal.html#forever
 
user1804599
terrible.
 
Probably forever([] { /* ... */ }); didn't look cool enough
 
8:42 PM
@MartinJames Who?
 
@MartinJames I wish I was the cup.
 
@MartinJames Cheers!
 
user1804599
@AndyProwl can't break/early return.
 
ah, yeah true
 
user1804599
Scala solves this by implementing break and return using exceptions. :D
 
8:43 PM
you can only break
@rightfold sounds odd
 
user1804599
Perl 6 and Ruby also do that.
 
@BartekBanachewicz never not game jam
 
user1804599
@BartekBanachewicz Yes!
 
user1804599
I want to write a video game in COBOL that is more exciting than Hangman.
 
Hangman2!
 
8:45 PM
Hanging snakes?
 
Bangman
 
user1804599
COBOL calling mechanism is weird.
 
Gangnam
 
user1804599
Whether a parameter is by-value or by-ref is decided by the caller, not by the callee.
 
8:46 PM
I'd like to write quoridor but I suck at network so I'm afraid I wouldn't make it during a jam
 
@AndyProwl I was thinking about Haskell Game Jam tho
 
@rightfold Nice.
 
@BartekBanachewicz why? It was always "use whatever technology you want"
 
@AndyProwl I know. "This was always" sounds like a place to experiment vOv
not saying imma force it or anything
 
Got it
 
8:47 PM
just thinking about it
 
Ell
sounds like not as many people would join in prolly
 
as a way to make things more interesting
 
I'm afraid I wouldn't be able to take part if it were Haskell-only
 
@Ell true, but we have a lot of haskellers already
 
Ell
nor me
 
Ven
8:47 PM
@rightfold php also had that
but they removed call-time pass-by-reference later.
 
user1804599
PHP having references is silly.
 
@rightfold Ew
 
I dunno
imho it's not that hard and you're underestimating your skill
 
user1804599
I should make a roguelike in COBOL.
 
I can't possibly be underestimating my skills. I've never written even a tic-tac-toe in Haskell
 
8:49 PM
 
@AndyProwl see that could be a nice opportunity
 
yeah but I would have to study the language again because I don't remember shit
 
user1804599
haha
 
user1804599
Andy just said Haskell is shit.
5
 
8:51 PM
lol no I didn't
 
meh ignore him
 
user1804599
@fredoverflow class Cube; object Cube // companion cube!
 
@MooingDuck So this seems to have fixed my sorting issue, but I don't understand why. Isn't if(left < right) return true else return false; implicitly the same thing as if(left != right) return left < right ?
 
@caps That doesn't return a value on all branches.
 
@caps Yes. it is. But your first version didn't have else return false.
@milleniumbug I made a modified quick sort too! coliru.stacked-crooked.com/a/122ea9781574b406
 
9:00 PM
@MooingDuck My first version had return false as the last line.
 
@caps with other member comparisons first
 
Why is an image saying "int main" starred?
 
what happens when right> left?
 
@MooingDuck Dang, that's long.
 
@R.MartinhoFernandes it's a gif
 
user1804599
9:00 PM
@R.MartinhoFernandes look at all the other frames as well.
 
@R.MartinhoFernandes it's a gif
 
it was
 
gifs are B A N N E D
 
I have FF set to animate only once.
 
user1804599
9:01 PM
no this one is good :(
 
And I wasn't looking.
 
if(left.member_one < right.member_one) return true;
if(left.member_two < right.member_two) return true;
return false;`
 
I'll keep it
 
robot didn't though
rip
 
9:02 PM
:c
 
Androidians?
 
I don't understand how that's different from
 
@caps so if left.member_one > right.member_one, then it checks member_two. Instead, it needs to return false.
 
This is a room that exists?
 
9:02 PM
@MooingDuck Ah, okay.
 
@milleniumbug Good try
 
user1804599
@caps return tie(left.member_one, left.member_two) < tie(right.member_one, right.member_two);
 
@EtiennedeMartel About a zillion Android rooms
 
@R.MartinhoFernandes Why can't they just merge their fucking needs.
inb4 XKCD joke about 14 different standards.
 
Android is terrible.
 
9:04 PM
Yeah, but does that need to extend to its community?
 
user1804599
You're an android yourself.
 
Yeah, but he's not from Google.
 
@MarcoA. wait, -~y means y+1?????
 
user1804599
@milleniumbug C++ should've allowed void main instead of adding implicit return 0;.
 
@EtiennedeMartel IME the community is the worst part.
 
9:06 PM
@milleniumbug half of it is comments, but yes. Also, no recursion. or allocations. It's a variant of quicksort. Ish.
 
@rightfold C# allows both.
 
@rightfold They probably thought "oh noes, all the earlier resources describing void main as illegal will have to be updated, so they'll say: 'you see, yes, it used to be illegal, but compilers didn't care, later compilers started to care, but you see, now it's completely legal, unless your compiler isn't up to date'". Shitty reason, I know, but it's one.
 
@R.MartinhoFernandes Windows Phone is even worse
Android is relatively ok.
 
@rightfold Special-casing return 0; in main actually bit me not too long time ago, so I'm all for void main() too.
 
user1804599
Symbian master race.
 
9:10 PM
@milleniumbug Sounds like an interesting story. Care to share?
 
@Jefffrey Meh, it's not that interesting.
Also, maybe I said wrong with "bit"
As in, didn't make a bug, but it was an annoyance for me.
I was writing a game in SDL, and they do #define main SDL_main
Which is a sign of shittiness in SDL, but nevertheless
while avoiding that, I wrote some cross-platform code to use WinMain on windows and main everywhere else, and called real_main.
Except now real_main has to return 0; if it returns int.
 
@Jefffrey I like Windows Phone
the only problem is app store limited selection
 
@MooingDuck The "avoiding recursion" quicksort-ish sort seems interesting, I'll take a look later.
 
Ell
@R.MartinhoFernandes which bit?
 
mmmm
strategic launch detected
 
Ell
9:17 PM
bloated? lack of control of permissions/security?
 
music to my ears
 
@Ell Every bit :)
 
The debugger is like the force, it's what allows you to go from tatooine code peasant to code jedi knight. Learn to use it! — Borgleader 7 secs ago
2
 
@Ell Both 0 and 1 :D
 
@milleniumbug First version was longer: ideone.com/cv6VsT (it's the inplace_sort)
 
9:18 PM
whaaaaat
 
@Puppy Yup
 
@milleniumbug interesting yes. useful no.
 
@milleniumbug Does that include the bits that exist in two different places at the same time?
 
@MooingDuck Hoooly shiiit
 
@Jefffrey it's about ~100 lines, half of which are comments
 
9:24 PM
@Puppy Qubits?
...no, that's different
 
Ell
9:44 PM
balls I was 7th
then some big ass dude just ate me
 
Xeo
McSnuggles
 
your master looks clean
 
@Xeo Awww, cute!
 
Ell
I want a cat
 
I want a beer
I possess a beer
I will drink the beer
 
9:54 PM
@Ell I haz two
 
Xeo
I want a second
Gotta get this one healthy again first, though
 

« first day (1682 days earlier)      last day (3270 days later) »