« first day (395 days earlier)      last day (4536 days later) » 

7:00 PM
I didn't even know std::endl existed until recently, \n' and flush() were enough.
 
@sbi Not entirely true, you can add template specializations to the std namespace.
 
sbi
@FredOverflow And I was just about to laugh at @Als being annoyed by pedantry...
 
Als
hmm
 
7:04 PM
@CatPlusPlus I strongly doubt gcc will compile that piece of code ;)
 
Als
Little help here to delete
-2
Q: Looking for a c++ standard library reference wall poster

Ivan BohannonI'm looking for some nice posters to hang on the walls after we remodel our work offices. I found a great msdn site with a bunch of c# / misc posters http://blogs.msdn.com/b/cbowen/archive/2007/12/09/got-tech-posters.aspx but, I'm having trouble finding a poster for the C++ standard library, ...

Some prick managed to downvote me on this old Q
8
Q: Code refactoring

AlsI am about to starting to work on a project which involves refactoring and modifying existing code which is in c & c++. The code is a bloated one and is in huge volume. Ofcourse since the code needs to be modified an understanding of the code has to be developed and in a very short span of ti...

I don't see why!
 
sbi
@bamboon I'll tell you a story which I always told my students: Years ago, while working on a rather big software project, a coworker came to me asking if I could help him find why his streams would buffer only up to a few bytes, thereby totally destroying the performance of his code. Our software was much slower (by a factor!) than a rival software for a specific task, and he had the boss breathing down his neck about that.
So he showed me what he had done to persuade the stream buffer to buffer several kB, instead of several bytes. I couldn't believe this was necessary, and refused to even look at his attempts before I had seen the code. It turned out that he had used std::endl all over the place, literally advising the stream to flush its buffer whenever a newline was required. When writing to a file, this put the program to a crawl.
He replaced all occurrences of that manipulator by '\n', and instead of being several times slower than the other program, he was about two times faster.
 
So java.lang.System.out.println("hello world"); should be a lot faster than std::cout << "hello world" << std::endl; right?
 
if you spammed it a million times
 
sbi
@FredOverflow As long as this sentence has that "should" in the middle, I'm not going to take the bait.
 
7:13 PM
And who wants to start his C++ journey by writing a "hello world" program that is slower than the Java alternative? :)
 
haha
C++'s "hello world" could run a thousand times before the JVM has even started up
 
but... FLUSHING TEH BUFFORZ!!!
 
flushing teh bufforz down the toilet
 
Today I heard a story about a student talking about the "Decoder" design pattern. Guess which one he meant :)
 
I like my cout line-buffered.
 
7:17 PM
@DeadMG Maybe not on Windows. Why is that standard terminal so abominably slow??
 
It's fast enough.
 
@FredOverflow Did he mean the "deceiver pattern", by which a student produces code that appears to solve the homework problem?
 
sbi
@FredOverflow The story I told was about creating files with a size up to several dozen MB, not about writing "Hello, world!". But just as I advised my students to always use pre-increment, even where it doesn't matter, because these things have to become habitual, I also advised them to always use '\n', and only use std::endl when they really needed it, even where it doesn't matter, because that, too, has to become a habit.
 
@FredOverflow Singleton?
 
@sbi I believe that and actually understand that if you write to a file and call std::endl everytime instead of '\n' is crap. I thought more of examples were performance is not the reason, for example of something like this: std::cout << vec.size() << std::endl; instead of std::cout << vec.size() << "\n";
 
7:19 PM
@DeadMG nope
@bamboon But what do you gain by using std::endl instead of '\n' here?
 
@bamboon yes, what do you gain ?
 
Als
@bamboon: You read this:
29 mins ago, by sbi
'\n' is C++' standard way of inserting a newline into a string or stream or whatever. If you want a newline, you want '\n', period. If you want a newline, followed by flushing the stream, use std::endl, otherwise don't.
 
You gain momentum!
 
sbi
@bamboon Just read the reply I made right before yours, about such things needing to become a habit. There's a lot of spots in C++ where you constantly have to be aware, lest you are tripped when you expect it least (like always adding explicit to constructors that can be invoked with only one argument), and IME the best you can do is to make it a habit to always do the right thing, even when it seems to not to matter.
@CatPlusPlus That's what the disk gains, you mean.
 
Someone unpinned the video list, or did it fall off by itself?
 
7:22 PM
@sbi Some people even go so far as to mark every constructor explicit, on the ground that it might someday become a constructor invokable with only one argument.
 
I routinely unpin stuff, but I don't recall unpinning that
 
sbi
@CatPlusPlus I repinned it.
 
How did all you guys become room owners?
 
sbi
@FredOverflow For one thing, I wouldn't want to clog my code with stuff that's not needed, or even confusing. ("Was this ctor meant to be callable with only one arg?") And also: YAGNI.
 
@KerrekSB By owning this room with our C++ skills.
 
sbi
7:24 PM
@KerrekSB Read the newbie hints. (I really, really, really need a shortcut for posting that.)
 
Als
@KerrekSB: Bcos we own it :P
 
@FredOverflow 1. I think it just makes it easier to read. 2.(more important) I always thought that it was safer to get done with things which might get dangerous. Not that you guys understand me wrong that I am argueing with you, you are the experts I am just a random noob, who wants to learn and period is only very rarely a good explanation
@sbi yeah thats true, it has even already become a habbit for me.
 
@bamboon period explains about 20% of female interaction ;)
 
@FredOverflow lol
 
sbi
@FredOverflow ROTFL!
 
7:25 PM
@Als I was first!
1 min ago, by FredOverflow
@KerrekSB By owning this room with our C++ skills.
 
2
Q: c++ callbacks - compile time alternatives to virtual functions

Simon ElliottI want a generically reusable class to be able to perform a callback. I've usually used a virtual function to do this: The generic class: class LibraryClass { private: virtual void SomeCallback(){} }; The code using the generic class: class AppClass; class LibraryClassWrapper: public Li...

LibraryClass, AppClass and no wonder this is tagged .
 
Als
@FredOverflow: I think I was last!
 
About design patterns, the "Decoder" was actually the "Decorator". And the student was certain that "Decorator" was just a special kind of "Iterator". Don't ask me where you got that idea from. They sound pretty similar, but that's about it.
 
@KerrekSB Because we're so awesome.
Now I'm the last, har har.
 
sbi
@Als You never know. I could post it, too, and then you would be merely mediocre.
 
7:27 PM
Deterator, a backwards Iterator.
 
Drinkerator
 
Als
@sbi: Are you still upset about the babboon thingy?
:P
 
sbi
@CatPlusPlus LOL! You weren't.
 
/help
 
sbi
@Als I wasn't, but now that you remind me, I might still fetch the Librarian.
@CatPlusPlus Wrong chat.
 
7:28 PM
Oh, did I turn that off.
Weird.
 
Als
Bonobo it is
 
No, I had userscript which responded to /commands.
 
@sbi I did read the Hints. They say it happens randomly. Now I'm trying to discern the pattern behind this randomness :-)
 
Apparently it broke.
 
Als
@KerrekSB: psst psst a hint: Appease us
 
7:30 PM
@Als Is this like an initiation thing or so, where you need to cut off the head of a goat and eat a can of live worms?
Or answer a Java question? (Whichever is worse.)
 
Sacrifice for the template god!
 
You mean @litb?
 
Template god is @litb's minion.
 
sbi
@KerrekSB For one, "If you hung around here almost daily for a few months, it's likely someone added you as an owner." isn't about randomness. But also, with so many users hanging out here nowadays, the policy might be not as simple to fully implement anymore. Finally, everybody the room info says is frequently here is a room owner.
 
Als
@KerrekSB: Well you need to be agile, You know different folks like to be appeased in different ways..some like to be said they are Genius, Some would like you to say Bonobo's are smarter than humans, some would want you to say "long live bots" & some might want some sex talk!
 
7:32 PM
I wonder what would constitute a suitable act of pain... debug a Boost template error perhaps, in public?
 
Als
And w are just getting warmed up here ;)
 
@Als I have a feeling that telling the wrong guy you're into Bonobos would get you back to square one in no time!
 
Als
@KerrekSB: Now the catch is to identify who wants what, that is the real game ;)
 
sbi
Oh, not everyone. Gotta fix that...
 
Als
@KerrekSB: If you can guess all of those I mentioned in there, We would know you are a regular here .
 
7:35 PM
 
It doesn't really work when the background isn't white.
 
@CatPlusPlus Why is the second half white instead of see-through? :(
 
@Als Wait, in where ... in that sentence about agility?
 
Als
7:35 PM
Oh Jerry gets kicked out?
 
Ohh, pruning in progress...
 
Als
@KerrekSB: Yup
 
@FredOverflow Non-transparent background.
 
Ah. This is very much like Guybrush Threepwood's insult swordfight
 
Als
@sbi: Dont touche my name!
 
7:36 PM
Only if you've roamed the island for long enough do you know your silly cows from your rubber and glue.
 
Als
You didn't get any?
Ahem...
 
sbi
@Als I haven't seen him here in a long time. Many others are here much more regularly now than he is.
 
Als
@sbi: And who gets added now? apart from litb who is our resident prankster
 
I think the bots are scandinavian...
Bonobos are smarter than humans, but not than old apes.
 
sbi
@Als There's now three users on the owner list who didn't make it to the chat server's own list of regulars (which has only ten slots, so...), and while I don't see a reason to remove any of them (they are all still regulars), I don't see a reason to add even more users either. YMMV, of course, and since you're an owner yourself you might add someone else to the owner list if you feel like they belong.
@KerrekSB That sentence clearly reveals that you have no idea what the terms mean you're throwing around there.
 
Als
7:43 PM
@sbi: I agree. I don't see regulars other than the ones already added.
@KerrekSB: Nah, you are failing...
 
I'm not considered to be frequently in the room anymore :(
I shall repent.
 
@Als :-(
 
sbi
@StackedCrooked As I said, the chat only has ten slots for that.
 
Als
@KerrekSB: Those are traits of people, who are regulars here.
You will know once you have been here long enough.
 
Today the director of development asked me if it's possible to throw an exception from a destructor..
 
7:46 PM
it is
I use that in my codebase right now
 
Als
@StackedCrooked: What did u throw on him?
 
@DeadMG possible
 
jesus titty fucking Christ, I'm cold
 
possible, yes
useful: extremely rarely
 
7:48 PM
@Als I just told him that's possible but strongly discouraged.
 
. <- female interaction ?
 
sbi
std::exception up("urgh!"); throw up; // time for that old joke again?
 
No, that's a dot.
 
ur talking abou that other kind of period?
hmm
i thought period is dot
 
Als
@JohannesSchaublitb: Are you filling up for the Lion?
 
7:49 PM
Full stop. Hammertime.
 
what does that mean "filling up for the lion"
 
Als
@StackedCrooked: Yes you can but Why?
 
sounds utterly nasty
 
@JohannesSchaublitb Period is not a form a interaction with females.
@Als You mean why is it discouraged?
 
I'm immensely curious.
 
7:50 PM
@StackedCrooked look into the stars list..
lol
 
@Als Why are you capitalising your sentences randomly?
 
Als
@StackedCrooked: I mean why would you want to throw from a destructor?
@CatPlusPlus: me?
Lion not lion because HE is the KING of the JUNGLE.
 
Yeah. I'm just curious. It's a little hard to read sometimes.
 
@Als He didn't want to do that. He was investigating a bug and suspected that a destructor was thrown from a destructor, but he didn't know if that was possible.
 
sbi
Oh, it looks like I'm all over the starboard. I suppose the correlation with me not getting much work done today is not accidental.
 
7:51 PM
took my duvet off my bed
 
Als
@StackedCrooked: Yeah maybe some exception spilled off some destructor..posible.
 
sbi
@StackedCrooked How's throwing around dtors?
 
@Als To construct exception building rvalues.
 
You get a dtor, and you get a dtor, and you get a dtor!
 
@sbi Can you paraphrase?
 
7:53 PM
right now, I have some code that's like T() << stuff << more_stuff; where ~T() throws
 
sbi
@StackedCrooked "a destructor was thrown from a destructor"
 
You're still reinventing Boost.Exception, eh?
 
@DeadMG dtors can throw
 
I thought that they did that so you could add things to the exception and then re-throw it
not a handy exception-constructing rvalue
 
7:54 PM
My colleagues are starting to ask all kinds of little things. "I saw that this constructor is throwing an exception. Is it allowed to throw from constructors?"
 
Als
@TonyTheLion: From now on we have stop posting nude and NSFW pixies inline,
post links instead.
 
why?
what arbitrary rule is that?
 
Als
Some peeps here have to answer q's if they are on C++ chat or porn chat
lol
 
@TonyTheLion A concensus was reached while you were away.
 
7:57 PM
pr0n chat, under disguise of C++
 
Als
@TonyTheLion: yeah kinda...
 
@StackedCrooked a census without my consent??? I'm glad to know I've been part of this chat long enough to not matter
@sbi hahaha
 
sbi
2 hours ago, by sbi
The other day my teenage daughter looked over my shoulder, and someone posted such a pic. She was a bit baffled about me being somewhere on the net where they post pictures of young girls too poor to buy their clothes, so I had to explain to her that the C++ chat is full of young, horny males, and that nothing will stop them from discussing sex and posting pictures. Sigh. I hope she understood. I am divorced from her mother, and such issues can bring up all kinds of trouble...
2 hours ago, by sbi
Oh, that and I really, really, really don't like to watch 24 year old girls that are setup to seduce. I am passed that age where all you value is firm breasts.
 
@sbi oh now I understand, but that wasn't a nude picture of anything... just a piece of text
 
sbi
7:59 PM
@TonyTheLion Yeah, and I didn't object.
 
@sbi Just explain her about Tony.
 
> and that nothing will stop them from discussing sex and posting pictures.
lol
 
Hi, since I have just gained enough reputation to join the Chatroom - I thought I would say hi; So 'Hi' and 'Hi' again... don't have much to chat about yet! - maybe another time...in the mean time: stay error free! and I'll be saying 'bye' for now' so 'Bye', 'Bye'
 
@sbi you do have a valid reason to object, which I hadn't considered
 
@sbi Oh wait, that's what you basically did.
 
sbi
8:00 PM
@TonyTheLion And I wouldn't call this a consensus. I agreed to @Als over that, and encouraged him to tell it to others.
 
@StackedCrooked there's nothing to explain about me, I'm just....
trolling about sex sometimes
 
sbi
@StackedCrooked I did not object to the picture @Tony just posted.
 
Als
@Mrleighman: Hello. I answered your Q before I see
 
@sbi oh I see...
 
Hello 'Als' Yes thanks for answering my question.
 
sbi
8:02 PM
@StackedCrooked Why? It's not like there aren't another half a dozen here who aren't similar, although @Tony somehow managed to get the reputation of being the worst.
 
he's the only one that posts pictures
 
@sbi That's what I meant. And a story is always more credible if it has characters with names.
 
@sbi I'm not sure where I got that reputation??!!!
 
sbi
@Mr_leighman Hi, welcome to the C++ Lounge. You might want to read the newbie hints, linked from the right. Among other things they tell you why @Als is better than 'Als'.
 
Als
8:03 PM
@TonyTheLion: @sbi, quoted the instance about his daughter and so did @Xaade, So i thought what the heck lets paste links not inline pics
 
sbi
@TonyTheLion You got it here, that I'm sure of.
 
@TonyTheLion You didn't receive this reputation at a discrete point in time.
 
Als
@Mrleighman: No Problem. Glad it helped you.
 
@sbi Yeah
 
sbi
@StackedCrooked Is that a roundabout way to say he's done a lot for receiving it? :)
 
8:04 PM
@StackedCrooked No I worked studiously to get this reputation, and I have to keep it up :P
 
Als
oh okay too late
need to run
 
@sbi Sort of :)
 
Als
Have a good day all.
 
@Als See ya later.
 
8:05 PM
Good day??? It's evening here
 
@sbi You can throw destructors? I thought you could only throw exceptions.
 
Yes @ALS attention to detail is the Key, I think I'll take your advice and read the hints, nice to be in the'3rd room' and all...
 
throw &Foo::~Foo;
 
well I sure can't throw your mother, she's too fat! O_o
2
 
8:05 PM
3rd room? We're the first, dammit.
 
we're the champions!
 
Or rather the '3rd place'!
 
@StackedCrooked Not legal
 
@DeadMG LOL
 
This is the best room
 
8:07 PM
@DeadMG Too bad :(
Yeah, we don't for quantity, we're all about quality man.
 
we r the WinRAR™
 
sbi
@FredOverflow I can't, but @StackedCrooked seemed to think he can.
 
@FredOverflow Your mother is so fat, the integer representing her mass can't fit in a 128bit address space.
 
oh wow, mother jokes
 
8:10 PM
Wasn't that my joke?
 
no, I'm pretty sure I came up with this one, although previously I said 64bit
 
@sbi Where did I say that?
 
Your mother is so fat the Universe is shaking when she's moving.
 
Your mother is so fat, science mistook her for Dark Matter
 
sbi
@StackedCrooked Just follow the chain of linked replies.
 
8:11 PM
ok people, enough of the sad jokes
lol
 
they're hilarious
 
The rhino is dying out because your mom ate them all.
 
on the left side, you have the absolutely lowest common denominator "your momma" jokes
and on the right side, you have high intellect and scientific knowledge
the contrast is hilarious
 
Do you mean I'm on the right side?
 
8:12 PM
no, you're on the left
 
im in the middle
 
only people who can crack "your momma" jokes that depend on excellent scientific and/or computing knowledge get to be on the right
 
I'm upstairs.
 
You momma is fat because she is consuming more calories than she is burning.
 
8:14 PM
rofl
 
niiice
 
Your mother is like a fat-fueled star.
 
Greece is bankrupt because yo mamma didn't pay her restaurant bill there.
 
8:17 PM
Your mom is so fat, they started a whole scientific field on using her biomass for alternative fuel.
 
hahahah
 
Yo momma is so fat that airplanes have to fly in an arc around her to avoid being pulled down by her gravity.
 
Yo mama's so fat that the long long numeric variable type in C++ is insufficient to express her weight.
Yo mama's so slow and dumb that she can be emulated on a 286.
 
CERN wanted to make a black hole to see how dense exactly your mother is.
 
CERN was founded in order to gain understanding about the fatness of your mother.
 
8:20 PM
lol
Your mom is so fat she even throws through catch(...)
 
Your mom is so fat, they found the link between relativity and quantum mechanics, because they had to use quantum probabilities to estimate her weight.
 
your momma's so fat, Dark Energy is just her breathing out
 
@JohannesSchaublitb You mom is so fat she collapses before reaching the nearest catch statement.
 
Your mom is so fat, the world used to be flat. Her gravitational force changed that.
 
8:23 PM
lulz
 
Where is throw? It's still under yo mama.
 
your momma's so fat, she contains enough mass to activate the Alcubierre Drive
 
@DeadMG integers aren't addresses
 
Your mom is so fat, the last time they wrote a throw statement against her, USA thought it was China hacking again, cause it took out the internet and the power grids.
 
Yo momma burps Higgs bosons.
 
8:26 PM
@FredOverflow No, it can't fit in a 128bit address space
so your momma's mass has to be over 2 ^ (2 ^ 128)
 
I wanted to post a picture of yo momma on the Internet but she didn't fit in the picture.
 
Your mom is so fat, Intellisense self-actualized before finishing parsing her.
 
I wanted to post a picture of yo momma on the Internet, but she didn't fit in the Internet.
 
Your mom is so fat, the last time we tried to upload a picture that fit her, the internet ran out of space.
 
8:28 PM
ur mommy is so fat her bed sleeps on her
 
There's 3 dead cats in the skin folds round her belly.
@FredOverflow I just realized that this is not a shop.
 
Your mom is so fat, Pluto doesn't qualify as a planet anymore.
 
Because if Pluto were a planet then your momma should be counted as one too. And the science community didn't want that. So they stopped considering Pluto to be a planet.
Your mom is so fat that the solar panels don't work anymore.
 
8:35 PM
Your mom is so fat, she inspired the dyson sphere.
 
You momma is so fat, she could be harvested as a green energy source.
A head-related transfer function (HRTF) is a response that characterizes how an ear receives a sound from a point in space; a pair of HRTFs for two ears can be used to synthesize a binaural sound that seems to come from a particular point in space. Some consumer home entertainment products designed to reproduce surround sound from stereo (two-speaker) headphones use HRTFs. Some forms of HRTF-processing have also been included in computer software to simulate surround sound playback from loudspeakers. Humans have just two ears, but can locate sounds in three dimensions – in range (dista...
 
do you folks think it's bad if an interview turns out the candidate doesn't know about static initialization order fiasco?
 
If he's new to the language he can still be a promising candidate.
He loses a point for not knowing it. But he doesn't need a perfect score to pass.
 
@JohannesSchaublitb Are you an interviewer?
 
That's just my opinion. I probably wouldn't pass your interview anyway :D
 
8:48 PM
what's that
 
@JohannesSchaublitb a person who conducts an interview
 
interview |ˈintərˌvyoō|
noun
a meeting of people face to face, esp. for consultation.
• a conversation between a journalist or radio or television presenter and a person of public interest, used as the basis of a broadcast or publication.
• an oral examination of an applicant for a job, college admission, etc. : I am pleased to advise you that you have been selected for an interview.
verb [ trans. ] (often be interviewed)
hold an interview with (someone) : he arrived to be interviewed by a local TV station about the level of unemployment.
 
never heard about "interviewers"
i'm a programmer
 
@JohannesSchaublitb See the bottom line of my message above.
 
@JohannesSchaublitb Then why are you talking about some interview then?
 
8:49 PM
because i interviewed some people
 
He's like the guy from the movie Memento.
 
but i'm not an "interviewer" or something
 
are you trolling?
 
what is static initialization order fisco?
 
Have you been reading the spec again?
@bamboon AFAIK it simply means that the initialization order of global statics across different compilation units is undefined.
 
8:52 PM
ah ok, and how can I avoid it?
 
I think a good solution is to use function-local statics instead.
Foo & GetFoo() { static Foo; return foo; }
 
yes, T *getit() { static T *t = new T; return t; }
@StackedCrooked just beware that has the static finalization order fiasco problem
not that much a real problem but one needs to know
 
@JohannesSchaublitb I just know that finalization happens in reverse order as initialization. Is there a problem?
 
do static objects which are dynamically allocated not need to be deleted?
 
@bamboon You still need to delete them (if you don't want to leak).
 
8:57 PM
@bamboon not necessarily
if you don't need its dtor to be run
for example, std::cout's dtor is never run
 

« first day (395 days earlier)      last day (4536 days later) »