« first day (477 days earlier)      last day (4486 days later) » 

11:00 PM
@Xeo oooh seems clang are having some difficulties in the c++0x department
 
Xeo
@sehe Well, initializer lists are one of the features that's missing
 
we can moan all we we want about gcc, but it is still the best compiler I can think of for c++11 stuff
 
Xeo
constexpr is nearly done
 
well I've got to sleep
wish me luck for my examination tomorrow
 
11:00 PM
Tough luck.
 
@KerrekSB Thanks on advice. With what command did you achieve to look asm code?
 
Xeo
[04:43:52] <zygoloid> gotta get constexpr done before Kona ;)
[04:44:53] <Xeo> zygoloid: What's missing?
[04:45:26] <zygoloid> Xeo: instantiating constexpr functions in unevaluated contexts during overload resolution / null pointer checking
 
heh
I already have that
repeatedly
 
@Xeo Yeah the guy ("Richard?!" - facepalm by Herb Sutter) worked 6months + on it?
 
@DzekTrek It's -S. I edited that into his answer.
 
Xeo
11:01 PM
@sehe 4month
Also, when did he face palm?
 
Thanks, @RMartinhoFernandes .
 
@DzekTrek gcc -S -o x.s x.c
 
@Xeo I thought that reaction was rather peculiar (during the first (I think...) panel session in GN2012?)
 
Xeo
I don't remember that, hm
 
@Xeo I'm sure it was humour, or I got it wrong (it could have been: "Oh my god, MSVC is never gonna get this done/right")
 
11:03 PM
Yeah...
 
@KerrekSB I appreciate it. Thanks. :)
 
@RMartinhoFernandes Did you see the facepalm/exasparated gesture?
 
Xeo
But Chandler at GN sure was a highlight. :) During his talk aswell as in the Q&A panel
 
Nope, I think was looking away at the time (cooking).
 
Kev
folks....why are you not closing this as a dupe of something: stackoverflow.com/questions/8839943/…
 
11:05 PM
@Xeo Absolutely. He was very knowledgeable and communicative at the same time. You don't often see technical people represent a project so well
 
Kev
I'm no C++ programmer but that question is basic basic basic.
 
Xeo
@Kev Give us a duplicate example and we'll close one of them, depending on the answers
 
@Kev will SO become better if we will close it?
 
@Kev As are 80% of C++ questions here, actually :(
 
Xeo
@RMartinhoFernandes Strike that "C++"
 
11:06 PM
@Kev: it might be up for merging (it has a valuable answer). However set that bounty on it might not have understood the reasons for setting bounties too well though <grin/>
 
Kev
seriously though, question about "how do I clean up my objects and not leak"?
 
@sehe Wait, there's a bounty?
I thought I have nailed the thing once and for all!
 
Xeo
This question has an open bounty worth +150 reputation from user1131997 ending in 6 days.

The question is widely applicable to a large audience. A detailed canonical answer is required to address all the concerns.

Popular topic at SO, about memory leaks & management C++ , help make this wonderful topic more popular to people!
(btw, the one who offered that bounty was the OP himself)
 
@Kev: not really, in fact if anything it was it was waaaaaay too localized. I think we did right to commend this user on creating a separate question.
 
Kev
yeah the bounty is preventing anyone closing :/
 
11:08 PM
@RMartinhoFernandes (just noticed it)
 
@Kev, well, I'm up for closing other questions as a dupe of that one. That one has what I think is the best answer (but I could be biased, since it's my answer :)
 
Kev
@RMartinhoFernandes well...you would be :)
 
@Kev See the original dorky question (deleted) that I linked to in the comment (stackoverflow.com/questions/8828341/…)
 
Xeo
@RMartinhoFernandes Free-hand stars back up your claim
 
Kev
@sehe yeah I saw it, but that open one just makes a mockery of the site
 
Xeo
11:09 PM
@Kev Does it really?
 
Kev
it's "reference", go read a book
 
Xeo
It's an excellent example of the awesome answers you can get on this site
 
Kev
I love the answer, shame it's wasted on that question
 
@Kev the guy was just not getting it, and he was punching in all directions in self-defense. I think it was a very good thing (TM) that wehn he came round to ask a proper question, he got served, in a good way
 
I thought that question was a good one. It is hard to explain the answer
 
Xeo
11:10 PM
@Kev Yeah, but the robot's answer is orders of magnitude more expressive than most books, and it's something on SO. I thought the point was to gather great knowledge on SO?
 
@Kev a shame the question was so basic and localized, but then again, this might make it into the FAQ.
 
Kev
so you guys are saying there are no questions about new and delete on SO on the C++ tag that have never been asked and already have a good answer?
 
@Pubby I remember Eric Lipperts "Hotel" analogy to explain returned references to locals. It is the authoritative article on that nowadays. That was a basic question and had been asked (or at least come up) a zillion times.
 
Kev
not having a go, you folks are epic at shutting down bad questions
but how that slipped through baffles me
 
Is it an exact duplicate or something?
 
11:13 PM
@Kev: is there anything you think is candidate to merge it with?
 
Kev
@Pubby that's my point, see my question above ^^^
 
Xeo
@Kev this doesn't exactly apply, this only asks if leaks are OK, not why never deleting stuff is not OK, this... nope, completely different.
And that are the only questions above the one you linked that contain "memory leak"
 
@Pubby And yeah, the question has merit in that it is kind of clean and simple. Usually, explaining these bugs gets watered down in the answer to a 'find my bug' type of question.
 
@Kev I don't understand your question.
 
Xeo
@Kev: At this point, it makes more sense to close other questions as a duplicate of that one.
 
11:16 PM
Well, I didn't vote to close because the asker (a new user) was told in a previous question to ask that as a separate question. It would be silly to close it once he did that.
 
Kev
@Pubby the question is beyond basic.
 
FTR, in his previous question I provided links to related questions.
@Kev No, it's not. It's clear you don't see the kinds of basic questions we see everyday.
 
@Kev I think I spent 30 minutes typing out my answer. The question is basic but the answer is not.
 
@Kev basic questions aren't bad? It is annoying when they come up a zillion times, but this one doesn't. The topic is recurring. But, as I said, in the context of fuzzy bugs and other problems. This question is a rarity, IMO. I suppose it might even be the reason that someone was triggered to write a good answer to a well-chosen question.
 
Kev
@sehe I honestly can't believe that hasn't been asked before.
 
11:18 PM
Well, I'm sure you can look for the dupes yourself? I don't feel like looking for them. But the proof is in the pudding
(let me go back to the question and _read it_ better :))
 
Kev
well...how about at least fixing the english in the question ?
and if you folks want to keep it as a canonical then "go in peace" :)
 
FTR, yes, it seems it was asked before. Here: stackoverflow.com/questions/8288949/….
 
Xeo
@RMartinhoFernandes Who's with me to close that as a duplicate of the newer one? :)
 
Kev
We prefer that you don't close older questions as dupes of newer ones
 
@RMartinhoFernandes Good find. That is a close match indeed
 
11:22 PM
@sehe There's a reason my search skills are legendary.
:P
 
Kev
we had a big discussion about that over in PHP about newer canonicals
 
What happens if it gets closed? Doesn't hat mean that the question gets a link to the other and cannot get new answers?
@RMartinhoFernandes OT: is that causal or teleological?
 
Kev
@sehe yeah.
ok...there are flags hitting that question, so if you want to keep it open and win a bounty then please can you fix the question? The english is appalling.
 
It would be more helpful to the public if the old one got a link to the newer one, in the sense of spreading the information. There is no harm in closing down for answers on either of them (but it would be funny seeing that there is a bounty on the newer (baffled)?)
 
@Kev Working on it :)
(I don't really care about the bounty, I already have enough rep from that)
 
11:25 PM
@RMartinhoFernandes I don't think you're even eligible for it since your answer predates the bounty...
 
Kev
@RMartinhoFernandes maybe expand it a bit as well?
@sehe any answer is "eligible to be manually awarded"
 
Expand the question? Condense it further! We don't need this to become another 'language blurb - guess the question' thing. A crisp question works a lot better IMO
@Kev Aha, I see. Thanks for the info
 
Kev
@sehe that will only increase the chances of more flags. I'm not suggesting pad out with fluff
 
@Kev Well, we're not here to fight flags. We're here to create good content. But ok, the question needs an edit :)
 
Kev
@sehe well the better that question can be, the better for all of us.
 
11:29 PM
I want to fight flags :(
 
Yup. And better might be shorter, in this case. If others don't get that, then I guess we're going to have to accept that. It happens everyday, the 'static' on the stack :)
 
Can auto-return types deduce the return type of the function itself? Like this:
 auto f() -> decltype(f()) { /* ... */ }
 
Kev
You know at least drop in a few lines of runnable code as a worked example
 
@KerrekSB nope. (that is an untested assertion). But it would have gotten noticed if it were...?
 
11:32 PM
@Pubby Woah, that is an awesome question with an awesome answer by sellibitze. I'm surprised it was asked in 2010. Ahead of it's time
 
@sehe Pretty sure someone has tried it at least in some controlled circumstances...
 
All the code needs to be runnable is for the irrelevant details to be filled in. If I anyone feels like it needs more, go ahead and add it. As long as it doesn't lose the point of the original.
Even if it gets closed, I'll still sending people over to that one.
 
Kev
Ok...I've dismissed the flags, but the next mod might just kill the bounty and close, just sayin' :)
 
Xeo
Urgh. robot, got time to test some code in GCC 4.7?
 
Fire away.
 
11:34 PM
@KerrekSB Yeah, like everybody has tried to capture a reference to a lambda from inside the lambda itself. Programmers will try to get close to other languages (return type deduction, named closures) all of the time.
@Kev Thanks anyway!
 
Xeo
@RMartinhoFernandes No need, I just noticed GCC 4.5.1 already implements the behaviour: ideone.com/bClFo
 
If only C++ lambdas were not C++ lambdas :(
 
@Kev I do agree with killing the bounty.
 
Xeo
Clang is crashing here during LLVM IR generation
@Pubby Wut?
 
Kev
@sehe no probs.
 
11:37 PM
@RMartinhoFernandes and I linked back for now
 
@sehe Sorry, you'll have to explain what causal/teleological means.
 
@Xeo ??\
 
@Pubby What do you mean "/"?
 
Heh, typed a trigraph by mistake
 
Xeo
@Pubby Well, what do you mean with that statement?
 
Kev
11:38 PM
@RMartinhoFernandes well, you're answer is epic (well they all are) I'd hate to rob you for your efforts because I reckon you're hitting daily the rep limiter now
 
@RMartinhoFernandes 'There's a reason for that' could mean: "There is a reason that causes me to be good at..." or "There is a reason ('cause') for which I'm required to have that skill"
 
@sehe I think STL did that in one of his shows, actually. But let me just run a few tests. It'd make templaty helpers much simpler to write!
 
@Xeo I just mean they aren't as cool as other lambdas
 
Xeo
@KerrekSB std::function<void()> f = [&f]{ f(); };
 
@KerrekSB Re: " did that in one of his shows" - woah. Colour me interested, I concluded (with Dave Abrahams IIRC) that it couldn't be done? Maybe I'm wrong (let's hope so)
 
11:40 PM
@sehe Ah, I meant that there is a reason that causes my search skills to be legendary: the fact that they're great.
So, causal.
 
@RMartinhoFernandes Check. Just curious :)
 
Xeo
@sehe It can't be done without a helper (like std::function). During an auto initialization, you cannot refer to the name of the variable from inside the initialization
 
@Xeo Aha, quite simple, if that works. Don't know why I didn't think of it. I wrote my functional-style algorithm using a local struct as a functor. It felt so dirty :)
 
@sehe I'd have to check. I think he said something like "This might not be supported widely yet, but...", but I may well be wrong.
 
11:42 PM
@KerrekSB Nah. It could work, I'm sure I didn't try/want std::function for some reason
 
@Xeo Wow, time exceeeded and not stack overflow. Maybe GCC is TCOing it.
 
Xeo
@RMartinhoFernandes Ideone says no execution time over 5s (or 15s if you're registered)
 
(Or nuking it altogether)
 
@Xeo Bwahaha. runtime exceeded. At least do a fibonacci or something :)
@RMartinhoFernandes My vote is with TCO
 
Xeo
Oh, that.
 
11:43 PM
recursive function: noun, a function that computes Fibonacci numbers in the less efficient manner possible.
 
@RMartinhoFernandes I just checked: TCO indeed. -O0 stack overflows, -O2 runs infinitely
@RMartinhoFernandes Yeah, but it will bottom out, and it will seem to be useful
 
Xeo
I actually had to look up what the base cases for fib were...
 
I use i < 2.
And it's 1 for both.
Fail.
 
Xeo
@RMartinhoFernandes The Other Wiki says 0->0, 1->1
 
@sehe Should I ask it as a question?
 
Xeo
11:47 PM
@KerrekSB I think it was already asked
 
@Xeo Oh, bastards use it one-based.
 
@Xeo Oh cool
 
... which is actually closer to the original formulation. Ok, I fail.
 
Today is a very slow day for rep :-(
And a fast day for duplicates, it seems
 
I'm at 120, without answering anything yet.
 
11:50 PM
I did my best and got a lousy 20 - spent about 2 hours on 3 answers I guess
 
@RMartinhoFernandes Bounty, or just past question upvotes?
 
@KerrekSB Someone posted a bounty on the memory leak question and that attracted a new surge of votes.
 
@Xeo Mmm. Interestingly it fails to run (ideone.com/aRvus) when you actually use the result. It works quite nicely on my box
 
@RMartinhoFernandes Which question?
 
Xeo
@KerrekSB free-hand stars
 
11:52 PM
Freehand sound.
 
Xeo
THE FUCK, I again managed to kill Clang...
 
Zing.
-10
Q: Explain how loops can be utilized in array processing. Please provide pseudocode examples in your response.

user1191296Not sure how to word this. This is like Chinese to me. What do you guys suggest?

 
Xeo
Seems to have something to do with expression SFINAE
 
Great suggestions in the comments.
@sehe Duh. f(15) is not EXIT_SUCCESS.
 
Xeo
Robot, GCC 4.7 this please: ideone.com/y4DJ7
 
11:55 PM
@RMartinhoFernandes Oh. Duh indeed. I don't see why it says 'runtime error' though (there isn't one). There is an exitcode and I didn't see that shown
 
@Xeo Say what?
 
@sehe Yeah, that is a stupid quirk of ideone. I tried to use return to avoid #include <iostream> before, and that bit me as well.
 
@RMartinhoFernandes That's lovely. I like how the prof request Please provide pseudocode examples in your response for a C++ course
 
[rmf@aarika test]$ g++ test.cpp
test.cpp: In function 'int main()':
test.cpp:18:28: error: no matching function for call to 'serialize(std::ostream&, X&, int)'
test.cpp:18:28: note: candidate is:
test.cpp:4:6: note: template<class T> void serialize(std::ostream&, const T&, int (*)[sizeof ((obj.stream(os), char()))])
test.cpp:4:6: note:   template argument deduction/substitution failed:
test.cpp:18:28: note:   mismatched types 'int (*)[sizeof ((obj.stream(os), char()))]' and 'int'
[rmf@aarika test]$
@Xeo there.
 
@RMartinhoFernandes Well, at least return f(15) still helps to avoid the optimizer just elminating the call to f in the firsrt place
 
11:57 PM
Argh.
 
Xeo
@RMartinhoFernandes Interesting. Why the hell doesn't the 0 get converted to a nullpointer..
 
??
null pooter :) (think STL's accent)
 
Xeo
Riiight, and this works. -.- ideone.com/FcXej
 
@Xeo Lemme actually look at the code...
 

« first day (477 days earlier)      last day (4486 days later) »