Mar 29, 2021 16:33
"void Graph::DFS(std::function<void(int)>&& action);" Any reason for this rather than const std::function<void(int)>& action?
 

 The Nineteenth Byte

The Nineteenth Byte: General discussion for codegolf.stackexc...
Apr 3, 2018 05:20
Might have just been bumped to the front page because of the first answer, but I wanted to know if there was something special going on
Apr 3, 2018 05:18
Anyone know why this old of mine on Approximating a Bell Curve has been receiving a number of answers today/yesterday?
Jul 19, 2017 05:38
Dang I can't get my idea for the CnR problem to work. I wanted to make it so you had to use something obscure from the standard, but it turns out that you can simply use something pretty obvious. Maybe I should just post it
Jul 19, 2017 05:18
Okay, time to make a meta post about the ambiguity
Jul 19, 2017 05:17
When handling chat spam flags, what does "valid" vs "invalid" mean? 1: The flag is valid/invalid. 2: The message is valid/invalid
Jul 19, 2017 05:03
@JanDvorak I know, but I'm talking about for an answer for the CnR challenge
Jul 19, 2017 05:00
@Justin except the problem being that there'd have to be non-standard behavior / undefined behavior, but I want to, e.g. say you can't use __attribute__ and other gcc extensions
Jul 19, 2017 04:59
Would it be valid to restrict the language to, say, standard c++ (no extensions)?
Jul 19, 2017 04:49
@Justin Found the answer. Yes it is valid
Jul 19, 2017 04:28
I'm looking at the new CnR challenge and I'm thinking about posting a submission. Is it valid for the 2nd snippet to exit abnormally (I can fix it, but I'm curious)?
Jul 2, 2017 00:10
I drop by to upvote low voted answers, and I post answers every now and then.
Jul 2, 2017 00:10
@Mendeleev ? Anything wrong with that?
Jul 2, 2017 00:08
@Christopher No hard feelings. I don't even know you (on ppcg). It's been a long time since I was actively active on ppcg
Jul 2, 2017 00:02
Or I guess I could just put it on the active list because I do visit occasionally, likely more than once every 60 days
Jul 2, 2017 00:01
The thing is that it's for the same thing, so if it's split, it might not be as clear that there's actually more rep on the line
Jul 2, 2017 00:00
@EinkornEnchanter In the Q you mean? The "Offered bounties by ..."? Except I'm a passive member.... But as long as I get notified, I'd definitely award the bounty
Jul 1, 2017 23:59
Okay, makes sense
Jul 1, 2017 23:58
@EinkornEnchanter I guess the question is, should I edit it into the answer and the question in addition to a comment?
Jul 1, 2017 23:53
Does a comment on one of the answers suffice?
Jul 1, 2017 23:52
On the List of bounties with no notification, how do I add to someone's proposed bounty?
 

 UX Chat

User Experience (ux.stackexchange.com) community chat room: ta...
Dec 18, 2017 19:19
Dang, this chat is relatively dead
 

 The 2nd Monitor

General discussion about codereview.stackexchange.com - Welcom...
Oct 11, 2017 22:35
@200_success Exactly what happened
Oct 11, 2017 22:32
Yeah that's what I meant, is I think it should be until the end of the contest. @200_success could maybe renew it?
Aug 14, 2017 20:05
@Mast Yeah, but I was under the impression that minimal questions are still valid. There's kind of a default implied question for questions on this site. I think it would be better with more text explaining the question, but it is still reviewable...
Aug 14, 2017 19:30
@Mast Why is it awful?
Aug 14, 2017 19:28
But isn't it better to improve the previous question rather than post a new one?
Aug 14, 2017 19:26
User edited a post, making a future post duplicate of original. Currently, this is an exact duplicate of this
Aug 10, 2017 08:56
Well, gn. I can sleep now this is resolved. Ty all
Aug 10, 2017 08:55
@Heslacher Nice. Good bot, Duga
Aug 10, 2017 08:53
@Vogel612 does Duga notice when the edit is by rejecting a suggested edit after the suggested edit is approved? Because that might be why Duga didn't notice
Aug 10, 2017 08:50
Doesn't look like pseudocode, though. And I misunderstood what the user had meant about abbreviating the code
Aug 10, 2017 08:49
Ty though
Aug 10, 2017 08:49
I didn't notice it was edited again until the user pinged me a few minutes ago
Aug 10, 2017 08:46
@Vogel612 the question
Aug 10, 2017 08:43
I should be sleeping, but instead I'm salty over this bad question edit. Xkcd applies well here
Aug 10, 2017 08:37
Hooray for users invalidating parts of answers with code edits \o/ /s
Jul 5, 2017 22:31
@Duga Actual answer invalidation...
 
Mar 27, 2017 19:00
But if you want it to be perfect and have optimal performance, it's pretty difficult to get right.
Mar 27, 2017 19:00
I guess my point is that it's easy if you don't worry about it being perfect
Mar 27, 2017 19:00
It is possible to make it so that max(myInteger, 2, 3) creates a compile error, though.
Mar 27, 2017 18:59
Unfortunately, it's not really possible to design a completely robust max function for all reasonable use cases that doesn't require the user to be careful in order to avoid obscure bugs.
Mar 27, 2017 18:58
Yes
Mar 27, 2017 18:56
IMO a max function should take its parameters by value because you avoid the hairy problems altogether and because it will mostly be only used for integral values, which should be trivially copyable/movable. And then you don't get bugs from max(myInteger, 2, 3)
Mar 27, 2017 18:55
I know there are edge cases. I've done a lot of template metaprogramming as well. But it's not hairy. It's simple enough to just write something and fix it when necessary.
Mar 27, 2017 18:53
Yes that's what { ... } does.
Mar 27, 2017 18:53
@Incomputable It's easy enough to fix that; you could just do a static_assert in the function.
Mar 27, 2017 18:50
Mar 27, 2017 18:50
@Incomputable It's not a good idea in general to take the parameters by reference because it becomes incredibly easy to get dangling references. Notice that even std::max with an initializer list does not. Other things: "no recursion version" is not needed at all. With literally any level of optimization, the exact same assembly is generated. My point was that it's not too much work to write an n-ary max function as long as you kind of understand how templates work; you don't need tons of metaprogramming ability. Creating a perfect function is usually unneeded.