« first day (838 days earlier)      last day (4109 days later) » 

9:00 PM
lifted from some old logging code and cleaned up a tiny bit
 
@jalf that works? wtf
 
@jalf Cool!
 
ah. it can't tell its going to recurse I guess until after the token pasting
 
Why do people suggest editing the way braces are?
 
hmmm
is it "As N tends to infinity" or "As N trends to infinity"?
 
9:03 PM
"As n approaches infinity" or "As n goes to infinity"
 
"When n equals infinity."
 
zz
 
"tends" is correct afaik - but then again, when is anything in a language set in stone
 
We're talking about limits right?
\lim_{x \rightarrow \infty} f(x)
 
@Mysticial o u
 
9:07 PM
@Mysticial Now you know that's just wrong. It should obviously be "when n is infinite".
 
idk if its strictly correct but I think tends has the same root meaning tendency
 
"while (n < mother.size()) ---> while (true)"
2
Is how the compiler will optimize it.
 
@LucDanton lol
 
@Mysticial C++ allows elision of infinite loops, so it will just elide the whole thing, silly
 
@doug65536 shit
So you're saying that your mother is so big that she doesn't even matter?
 
9:10 PM
@doug65536 Your mom is volatile.
 
Is std::endl giving me segmentation fault?
 
Your mom is in a one-to-many relationship.
6
 
@Jeffrey UB.
 
@R.MartinhoFernandes, UB?
 
undefined behaviour
 
9:12 PM
Anything can happen. Your code does something nasty and you get the effects in std::endl.
 
@R.MartinhoFernandes, ok thanks.
 
You might have a null stream, or a stream with a null buffer. Or just corrupted the stack or something.
 
I love me
 
user142019
Try valgrind or a debugger.
 
user142019
9:14 PM
@FredOverflow I know. I always did.
 
@JerryCoffin misaligned SSE might GPF strangely like that. doubt it would make is so far though
what is the faulting instruction?
wait nevermind (slaps self in face) address is zero
 
@doug65536 C++ doesn't allow elision of infinite loops, it merely allows the assumption that a loop will terminate.
 
I don't think you wanted to ping Jerry.
@MooingDuck Pretty much the same for the case at hand.
 
@JerryCoffin a page fault wouldn't GPF, it would PF, how is it GPF-ing
 
@R.MartinhoFernandes well, since there's no side effects.... yes.
 
9:18 PM
@JerryCoffin wait nevermind, 13 isn't the exception
 
@doug65536 I don't think you want to be pinging Jerry...
 
@R.MartinhoFernandes Everybody just wants to talk to the most important person present.
 
Maybe Jeffrey?
 
@JerryCoffin ignore that, wc
 
@doug65536 As always.
 
Well shit. I wish I could read directions better
 
@MooingDuck lol
 
@MooingDuck Alright. Upvoted.
I dislike snark disguised as answers.
If you want to talk shit, do it in the comments. That's my opinion.
 
@EtiennedeMartel me too, though I'll ignore a little snark as long as it's otherwise a good answer, but he doesn't really explain anything.
 
9:21 PM
@MooingDuck Yeah, he's just swinging his ego around.
 
Thank you! Disabling SSE2 in compiler options worked like a charm! — Sunius 8 hours ago
^ OP
 
@Rapptz I know
 
@R.MartinhoFernandes Damn it.
 
@Rapptz OP couldn't tell rudeness if it slept with their mother.
2
 
@R.MartinhoFernandes Maybe OP doesn't care.
 
9:23 PM
a "12 year old" athlon is overkill for many commercial applications - like POS
 
Piles of Shit? :P
 
I wonder how burning a Quran stands in Islam. Do you get straight to hell or what?
 
(I know what it is)
 
@Rapptz How the fuck does a compiler without SSE2 manage to run VS2012?
 
@R.MartinhoFernandes I knew you did :)
 
9:23 PM
That's like asking a baby to lift your mother.
 
There's a very big difference between "Every two years" and "Twelve years"- especially considering the gains Intel made over AMD in those years. The performance of an Athlon XP is far, far below what any current program will target. I'm surprised that VS will even execute, and isn't compiled for SSE2 itself. — DeadMG 8 hours ago
 
@R.MartinhoFernandes Another casualty of the inferiority of dead trees.
 
@DeadMG Those things had not been digitalised yet.
 
Should I remove the on this question and replace it with ? Link
 
@R.MartinhoFernandes Hence my statement that their loss is a casualty of the inferiority of dead trees.
 
9:25 PM
Maybe out << std::endl (with out = std::ostream)? @R.MartinhoFernandes
 
@DeadMG I prefer to blame the idiocy of the guys who burned them.
 
evening chaps
 
> Typehints in format strings still suck ass.
lol
 
@R.MartinhoFernandes A man after my own heart, not that I'd phrase it quite that way.
 
How could one iterate a 2dimensional array diagonally?
 
9:26 PM
have fun trying to write generic code with printf formats
 
@doug65536 variadic templates?
 
@DeadMG I like how he just dropped that by itself in a thread where the author was asking for help.
 
@R.MartinhoFernandes It did greatly amuse me.
 
@Crowz ... not easily
 
whilst I agree with his assessment of type hints in format strings, I don't think it's actually unreasonable to ask someone to advocate on his behalf.
 
9:27 PM
@MooingDuck in concept, how would it be accomplished?
 
@DeadMG Yeah, he was completely out of line, even if right.
 
user142019
mefddd
 
user142019
I’m bored.
 
"With <person name> when <company name>." Fuck you Google, I am sure that is not what the sentence means. WTF kind of grammar is that.
 
@Crowz I'd go with the iterator being a pointer to the structure and the current position, that's easiest. When you iterate off an end, go the next diagonal "row". What are you doing that needs this?
 
9:29 PM
So no opinions on the question?
 
What question?
 
@Rapptz which question?
 
6 mins ago, by Rapptz
Should I remove the on this question and replace it with ? Link
 
Oh. Count me a "ja".
 
@Rapptz no, most people say "STL" when they mean the standard library, that's normal. And it doesn't look like part of the faq to me
 
9:31 PM
@Rapptz it has nothing at all to do with stl right?
 
No. Just strings.
 
OTOH, that's a really helpful and informative answer. What goes in teh C++-faq again? I'll look it up
 
@Rapptz even if a vector<T> was in there stl doesn't apply
 
Are 1 and 2 considered primes?
 
@MooingDuck Tis in the tag wiki.
 
9:33 PM
@MooingDuck Problem 11 of ProjectEuler.net
 
@Crowz 2 yes, 1 depends on who you ask, usually no.
 
@MooingDuck Usually things that are tagged with gets sent here via feeds.
 
@Rapptz yeah, it looks faq worthy
 
That's for curation.
 
Well I added the tag, feel free to revert if you feel it wasn't necessary.
 
9:36 PM
if applied to one, the rule would be "prime if it evenly divides only by one and by one" - so usually 1 doesn't count
 
1 used to be a prime number (19th century, not so much before that) but it isn't consider a prime anymore.
 
@Rapptz It got caught in the sub-prime loan scandal, and lost its status as a real prime.
 
@FredOverflow well, it was rather mathy in a way that could easily intimidate the mathematics-challenged students, I guess?
 
30
Q: Is 1 a prime number?

brynIs 1 classified as a prime number? And if so, why? If not, why not?

 
@ThePhD I eagerly await the first one
nom nom nom nom. — DeadMG 58 mins ago
lol
 
user142019
9:43 PM
@sehe xD
 
user142019
DAT IS GRAPPIG
 
@Zoidberg especially in context. He succeeds to make someone else's self deprecating humour look upbeat
Totally awesome. For a puppy
 
user142019
@sehe ever went to A Campingflight to Lowlands Paradise?
 
user142019
 
9:48 PM
@Zoidberg I finally managed to push something, does not look like it merged with master though.
 
@Zoidberg What is written there?
 
user142019
@JohanLarsson oh xd I'll look at it tomorrow when I have access to Windows again.
 
@DeadMG Yeah we were looking at that site a few days ago
Oh wrong site.
 
user142019
@R.MartinhoFernandes "Hey, don’t you have to catch the train? — Nah, I have tit enough." where "tit" ("tiet") is common dialect for "time" ("tijd").
 
Seems to be a duplicate of cppinstitute.org
 
user142019
9:50 PM
It’s a lame Dutch pun.
 
Where they "certify" you.
 
Lol.
CPP certification.
 
user142019
@DeadMG LOLWOT
 
It's all the bad things about Uni, condensed into a short burst of Kill-Yourself.
 
user142019
But ye
 
9:50 PM
a full ISO C++11 compliant compiler?
 
user142019
I’d rather write my own C++ compiler than writing Java.
 
no problem at all
 
user142019
Unless it’s a C++ compiler written in Java. :c
 
user142019
@DeadMG IMPOSSIBRU!
 
@Zoidberg ok it is nothing really, I will try to refine it some before scrapping it. The idea is to try to model a set of controls that can map to what the expression syntax looks like. Maybe that will result in less parsing and better possibility for input validation, idk
 
9:51 PM
is it instruction-set day or something? :P
 
@Zoidberg nope
 
user142019
@sehe okay
 
user142019
Reminds me of how I’d name my company if I had one—oxyMORON. Because it’d be run by a MORON.
 
9:58 PM
@DeadMG Have you been to their site?
Prerequisites: 2+ years experience working on a C++ codebase or similar language (Java, C#, C)
4
 
@R.MartinhoFernandes HAHAHA
 
user142019
@R.MartinhoFernandes HAHAHA
 
@R.MartinhoFernandes HAHAHA
bandwagon effect. But it is hilarious
 
do you still need preprocessor tricks to make a "tostring" for an enum in C++11?
 
user142019
So they require you to have worked on Java, C#, C, or on a codebase written in C++.
 
9:59 PM
@doug65536 Yes.
 
@doug65536 you never needed preprocessor tricks, they just made it automatic.
 
@R.MartinhoFernandes Seem s like right up his alley. Perhaps team up with Zoidberg ("why not...") and find Domagoj to facilitate
 
user142019
@MooingDuck really? :O
 
@Zoidberg really for which part?
 
user142019
@MooingDuck automatic enum to string.
 
10:01 PM
@Zoidberg sort of
 
> It's free.
 
user142019
Ah yeah, forgot—C++. Full of "sort of"s.
 
Is there an existing system to give each object of your class its own unique ID?
 
user142019
@chris Yes—address of operator.
 
user142019
I think. Right?
 
10:04 PM
@sehe They said the whole pi business deliberately detracted the student from the actual issue.
 
@Zoidberg Absolutely.
 
Yeah, an object's address works fine as an identity.
 
@R.MartinhoFernandes Well, as long as you don't care about objects of different types :)
 
Hold on, I'm just thinking. It has to be synchronized with an API.
 
@Zoidberg sort of, since the ID for an instance would change
 
10:05 PM
@FredOverflow Yeah.
 
user142019
@MooingDuck how?
 
user142019
@chris Placement new! :D
 
@Zoidberg if it is moved/copied to another address, like if it's returned from a function.
 
Overlapping objects are allowed in a few corner cases, but you won't have them.
 
user142019
@MooingDuck then you have a new object.
 
10:06 PM
@R.MartinhoFernandes Prerequisites: 2+ years experience working on a curly brace codebase.
 
@Zoidberg arguably, yes.
 
I'm just thinking about the copy/move semantics I want.
 
curly codebrace :)
 
user142019
@FredOverflow Haskell full of do {} notation and records? :D :D :D
 
Eww, use lines and lenses.
 
user142019
10:07 PM
Or Erlang and a lot of tuples? :D
 
std::string some_string = *reinterpret_cast<std::string*>(string_ptr); is this ok i.e. would this make a copy of the string? (string_ptr is LPVOID - ThreadProc).
 
It would, yes, but use static_cast.
 
alright, thanks :)
 
@chris static_cast? I always use reinterpret_cast for PLVOID.
 
user142019
10:09 PM
I always use nothing since I don’t ever use LPVOID.
 
@Zoidberg C API interop
 
56
Q: When to use reinterpret_cast?

HeretoLearnI am little confused with the applicability of reinterpret_cast vs static_cast. From what I have read the general rules are to use static cast when the types can be interpreted at compile time hence the word static. This is the cast the C++ compiler uses internally for implicit casts also. reint...

 
It's just void * to something *, which you pass in as a pointer anyway. How wouldn't a static cast work?
 
He suggests using static_cast for converting from and to void*.
 
@chris it would work fine
 
10:10 PM
Blueberry/vanilla tea y u smell like vomit?
 
Yeah, a reinterpret_cast does have its place in a lot of that, though.
GetWindowLongPtr comes to mind.
 
user142019
@FredOverflow Now I want vanilla ice cream. :(
 
user142019
*goes to fridge* :)
 
But with a void *, you're much better off passing a pointer than reinterpret_casting something that might be bigger than a pointer, right?
 
@Tuntuni everything I know about C++ says he has those backwards. researching...
 
user142019
10:11 PM
 
user142019
^ walkin fridge
 
@MooingDuck alright, i'll be here. if you find out something, fire. :D
 
@Zoidberg Heineken: aka Dutch piss.
 
hmmm
is it normal for parsers to be AST-less?
 
user142019
 
10:13 PM
@Zoidberg "Image not found"
Again.
 
user142019
Stupid onecockx.
 
@Tuntuni reading the official spec, I was wrong about reinterpret_cast, and I have no idea what it is for
 
@Zoidberg Does vanilla ice cream have taste? :)
 
@Zoidberg Wuts that?
 
10:15 PM
Well, that didn't work out as I'd hoped.
Ok, point taken. Can somebody please vote this answer down, so I can at least delete it and claim the "peer pressure" badge? :)
 
user142019
@EtiennedeMartel Piss water beer. It’s from GTA IV.
 
@Zoidberg Aah.
 
user142019
@FredOverflow Yes, it tastes like vanilla.
 
@Zoidberg That made me wonder:
 
Anyway, yeah, Heineken does not taste good.
 
10:16 PM
@Zoidberg But "vanilla" means "plain", doesn't it? ;)
 
user142019
Vanilla is a flavoring derived from orchids of the genus Vanilla, primarily from the Mexican species, flat-leaved vanilla (V. planifolia). The word vanilla, derived from the diminutive of the Spanish word (vaina itself meaning sheath or pod), simply translates as little pod. Pre-Columbian Mesoamerican peoples cultivated the vine of the vanilla orchid, called tlilxochitl by the Aztecs, and Spanish conquistador Hernán Cortés is credited with introducing both vanilla and chocolate to Europe in the 1520s. Initial attempts to cultivate vanilla outside Mexico and Central America proved futil...
 
@MooingDuck tbh, me neither. i always forget which one is for what so i stopped trying to remember them. when i need them i just browse to cplusplus.com and read away :D
 
@EtiennedeMartel It's beer, what do you expect?
 
@MooingDuck reinterpret_cast<T*>(p) for standard layout types is the same as static_cast<T*>(static_cast<void*>(p)). For other types it's implementation defined.
 
@sehe I expect decent taste.
 
10:17 PM
@EtiennedeMartel I have it
 
user142019
catch (Train const& e) {
    // :|
}
 
static_cast to and from void is always fine if you keep the same type..
 
@Zoidberg Woo for freehand trains!
 
How do you retrieve the max size of an integer?
 
What is up with you guys and your distaste for beer.
 
10:17 PM
(I'm going to get creative in my old age)
 
@Crowz INT_MAX or std::numeric_limits<int>::max()
 
@EtiennedeMartel It's not us that lack taste. It's entirely the beer that does the lacking
 
@crowz (std::numeric_limits<int>::max)() etc
 
@Zoidberg Has anybody ever proposed catch templates? :)
template<typename T>
catch (T&& anything)
 
Awesome thank you
Can you use printf instead of cout?
 
10:19 PM
@FredOverflow with SFINAE that might even be useful
 
I'm in the habit of putting the extra parens in because windows headers #define min and max
 
@doug65536 why on earth the parens there? It's not like ADL could kick in (since you std:: qualified it already). Oh wait! You're a windows.h victim!
 
user142019
@FredOverflow catch baseclass.
 
@Crowz it's generally a bad idea but it works
 
@doug65536 I thought of it in time
 
10:19 PM
@sehe lol yes
 
@MooingDuck why is it considered a bad idea?
 
@Crowz because printf isn't type safe
in my code just a few days ago we found a printf("%s", my_integer); (or roughly equivalent)
 
Nobody even starred my free hand trains. Better keep my dayjob, methinks
 
@Crowz Use the type-safe printformat I posted here a few times.
 
user142019
@FredOverflow requires runtime templates.
 
10:20 PM
@MooingDuck, Ouch. :(
 
@EtiennedeMartel Your dad is a one-too-many realization shipwreck.
@Zoidberg gimme gimme gimme
 
@chris the integer was zero, and I hadn't checked it in yet, so all's good.
 
user142019
@FredOverflow sure; libclang + dlsym.
 
@MooingDuck, Wow, that's still pretty unfortunate, though.
 
Ell
"runtime templates" ? isn't that dynamic typing?
 
10:21 PM
 
user142019
@FredOverflow expect terrible performance.
 
@Zoidberg ah, so it does
 
@sehe mine was different :(
 
@Ell effeectively
 
@Rapptz Better look for it, then
 
10:22 PM
@Rapptz I'm sorry not sure how to do that
 
@FredOverflow throw and catch pointers to exceptions, and you can get halfway there.
 
user142019
People flag link to The Onion. T_T
 
@Rapptz Mine is a PoC from the slides, I don't think it supports much
 
How do I invite users to already existing rooms?
 
10:22 PM
@Zoidberg You may approach the bench
 
@FredOverflow Click on their avatar on the side <-- and click "invite user to"
 
@FredOverflow the compiler would have no hope of generating code for that at compile time, right?
 
@Rapptz I only see "start a new room with this user".
 
@FredOverflow Only works if you're in the already existing room.
 
I am. Maybe F5 will do the trick... nope.
 
10:24 PM
will using break; on an inner loop break ONLY the inner loop?
 
@Crowz, Yes.
That's one of those situations for which people argue a lot over goto.
 
@Rapptz Wait, how do I click on the avatar from inside the other room?
 
errm guys, is there no make_unique in boost?
 
user142019
no
 
10:25 PM
Is that image clearer than my instructions? :(
 
that's lame
 
@bamboon there is no cookie in the jar
 
@crowz it will break only the innermost thing that can break. switch for while etc
 
We are getting std::make_unique in C++14, right?
 
@bamboon nah. it's an opportunity to feel good over achieving instant progress by writing code
 
10:26 PM
@Rapptz It works if I click on your avatar, but it does not work if I click on Zoidberg... which raises the question:
23 hours ago, by FredOverflow
user image
 
@chris it's not in the current draft IIRC
 
I thought it was just an oversight or something and more or less a quick fix.
 
@Rapptz "Invite this user" does not appear on Zoidberg :(
 
@chris I was told yes
 
@doug65536 yeah I have two loops here and I want to say "if (i%j!=0) break and increment i
 
10:27 PM
@FredOverflow Hm.. I don't know. :|
 
@bamboon boost has little C++11 stuff
 
@Crowz, Break out of one or both?
 
@Crowz one way to "super break" is to modify the outer loop counter so it won't loop. depends
 
user142019
@FredOverflow lolwot
 
@Rapptz I'm gonna clear caches and stuff, this must be something trivial.
 
10:28 PM
@MooingDuck yeah, disappointing
 
51
Q: make_unique and perfect forwarding

FredOverflowWhy is there no std::make_unique function template in the standard C++11 library? I find std::unique_ptr<SomeUserDefinedType> p(new SomeUserDefinedType(1, 2, 3)); a bit verbose. Wouldn't the following be much nicer? auto p = std::make_unique<SomeUserDefinedType>(1, 2, 3); This h...

 
user142019
@FredOverflow I know why.
 
user142019
I’m already invited to all your rooms.
 
Ell
oh feckk I haven't done my [fake]companies finances >.<
 
@FredOverflow obviously you need more rep
 
10:29 PM
@Zoidberg Oh, I see. Wanna hang out in the JS room? :)
 
@Rapptz tell that the boost guys not me
 
user142019
(I think.)
 
@doug65536 Oooo tricky
 
user142019
I’m in ur room.
Preventing u from inviting me.
 
@Crowz like: for (auto i = 0; i < 10; ++i) { for (auto k = 0; k < 20; ++k) { if (k == 2) { i = 10; break; } }
 
user142019
10:29 PM
@FredOverflow Sure. Linky?
 
It doesn't work so well on all outer loops, though.
So either a goto or an extra flag variable are sometimes needed.
 
user142019
@FredOverflow oh that JS room. xD
 
@crowz goto works too if you can withstand all the flying objects and punches in the head you'll get
 
user142019
I’m listening to a song, and they say "sehehehe". /cc @sehe
 
@doug65536 I dunno I like this way with the setting i
 
10:31 PM
And as long as the goto is used safely and clearly, I don't see a problem with it. while (outer) {while (inner) { goto endOfLoop; } } endOfLoop:
 
it's one of the few uses of goto that won't make you look stupid
 
@doug65536 THAT'S NUMBERWANG!
 
@doug65536 bool stop=false; for (auto i=0; !stop && i<10; ++i) { for (auto k=0; !stop && k<20; ++k) { if (k == 2) { stop=true; break; } }
 
goto is evil, but only until you actually use it for a situation where it's better suited. Beginners to the language will try to use it just because they can, so I agree to a certain degree of trying to hold them back.
 
Meh, I would rather get rid of the nested dependent loops.
 
10:36 PM
@MooingDuck adds an additional variable but 100% fine too
 
And if I cannot get rid of the loops, I drop them in a function. If it's complex enough to have weird control flow, it's complex enough to hide away.
 
Pseudo code... can anyone tell me if this logic would work?
 
Ell
I've never found a need for a goto that a different control structure wouldn't fix
 
I used goto extensively a long time ago ONLY for failure paths in C, with a bunch of labels after the return statement for each exit case. Worked well but I wouldn't do it today
 
10:38 PM
@Crowz if you're on the diagonal thing still, it's hard.
 
Yeah, I don't like that use.
 
oops forgot to free in the success case lol. shows how bad the technique can be
 
To be fair, we have RAII for that now.
 
@chris absolutely, that's why I specified C
 
10:48 PM
That's probably a large part of why I see that method as distasteful as I do.
I'm wondering if making a small ID class wouldn't be a bad idea. It'd be possible to specify the range bounds as template arguments, which could come in handy when your IDs can only be within a certain range.
And it'd be easy to use on a per-class basis with a template parameter for the class it's being used with.
 

« first day (838 days earlier)      last day (4109 days later) »