« first day (31 days earlier)      last day (4911 days later) » 

12:00 AM
@FredOverflow ok, reboot completed
 
oh god, this has become a nerdy article:
0
A: FAQ : Undefined Behavior and Sequence Points

Johannes Schaub - litbSequence points Sequence points are points in an execution of a program where all side effects produced by evaluations prior to the sequence points have been completed. Side effects produced by evaluations that occur after the sequence point will therefor be separated from side effects produced ...

i'm glad i've not quoted or referenced the standard at any place. i already see people asking for reference for various stuff, though xD
 
sbi
12:20 AM
"...until a sequence point has been reached, side effects produced by the evaluation are assumed to be still being processed"?
Also, I'd mention that many expressions are only evaluated for their side-effects. (std::cout << blah).
"...S(k, e) specifies a side effect m using an entity e" What's k? Where does m come from?
And it's too late form me to try to understand your diagrams. That'll have to wait until tomorrow.
Good night everybody!
 
good early night to tina
All: is there something more I should mention in this answer?
I thought it was fairly good answer but 0 votes so far... :-(
 
12:42 AM
@tina Eid Mubarak to you too (I had to google it...). and good night.
 
1:11 AM
What
 
1:22 AM
no
You don't call destructors manually, it is done automatically when the object goes out of scope
You use delete if you've newed. if your class has pointer members, you may need to delete them in your destructor yes.
Sometimes the destructor is used to free other resources
there's an idiom called RAII. Anyway, resources like file handles, mutexes, usually low level stuff
yes :)
I'm here, looking.
the parameters have default values yes
it's a constructor
 
1:57 AM
Evening gentlemen.
Ah. @tina is here. You know, I just thought about you today. A few days ago I said to you here some that was ... (hold on to your hats) ... Umm. Wrong.
I know. I felt the same.
I said that returning a const by value is useless.
And that's oh so very wrong.
The truth is that accepting a const parameter by value is in most cases useless. But retuning a const by value has its use.
In particular this striked me when I read an implementation of operator++(int)
operator++(int) should return a const by value. Because otherwise obj++++ might not have the effect you think it has.
So one should in general forbid code such as obj++++ by returning a const, and if it's by value then so be it. A const by value.
kthx
 
@wilhelmtell Don't.
 
mm?
 
@tina Please understand, when you say "I'm not satisfied" then it does not mean that you haven't yet understood completely. Or whatever. It tells people that you as their boss is not satisfied with their below-par performance. So it's pretty rude. But I'm guessing that you didn't know.
@wilhelmtell I mean, don't. In some cases people say meaningless things just to provoke responses. But in other cases it's just genuine miscommunication.
 
oh?
 
2:12 AM
yeah. sorry for the tone of that. it's late. i should be able to do better. :-)
 
I actually came here because of a conversation we had maybe a week or two ago. or maybe this weekend. for the life of me i can't remember. i was wrong, and duty forced me to rectify. I can't hold people from going to bed because of me being wrong.
 
actually scott meyers once recommended returning const object (by value).
 
yes yes, totally. part of the const-correctness, albeit sometimes overlooked.
 
he thought that would prevent silly usage of function calls in expressions
 
matters of lvalue and so on.
yes. totally.
 
2:15 AM
yes, it prevents C++0x move optimizations, so scott changed his mind
 
actually even before that, already it has issues with primitives. sutter said it causes clashes with templates instantiation.
if you return const primitive by value.
 
yes, and there was Andrei's Mojo for guaranteed RVO-optimization, sort of move thing for C++98. Andrei declared Scott's advice dead
 
well i think it depends. do you want to work with move or do you not? if so, you need to support it. if not, you should increase the fool-proof factor.
 
the o in rvo is already optimization :p
but yeah, i didn't think about the && thingything.
my mind is not yet completely at 0x
to be honest i don't see const returns-by-value very often.
but i think that it does make sense often.
again, postfix increment is a classical example. this is how primitives behave, so it's a good idea to immitate that.
 
2:20 AM
could, but it's all about expected context. at the time scott meyers recommended it, no-one thought about moving from the result of function call
 
yeah.
But if you have rvo in move then declaring const can't do any harm, can it?
 
Not for compiler-implemented RVO. Andrei's Mojo scheme was founded on detecting that a temporary is a temporary, using ordinary C++98. And you can't pilfer resources from a const temporary (e.g. function result).
 
pilfer?
 
"steal" :-) that's the idea of moving, to just move over those allocated buffers and whatever so to avoid costly recreation. "pilfer" because it's sort of underhanded, relying on nobody being able to see that it was done, because the temporary is just ceasing to exist anyway
 
I think a compiler can decide not to place the return value in RO memory. This is RVO. In this essence C++ implementation have had RVO for decades already.
 
2:30 AM
that's where i first learned you can't a pass a std::auto_ptr temporary to formal argument std::auto_ptr<T> const&. ;-) in c++98, that is.
 
I mean, std::string s = give_me_string(); is likely to pose some move operation here if the function returns a std::string.
likely, that is in the presence of RVO. which should be the case in a good compiler.
And I think you can still get rvo even if the function returns a const.
 
yes. the problem andrei and dave abrahams and others were concerned with was to guarantee it. andrei sought that for function results, like returning a huge vector with guaranteed move semantics; dave sought it for perfect argument forwarding
 
i mean the standard doesn't say what to do with the const. only to enforce it's a const.
ok but i don't see how this implies returning a const by value is a bad idea.
true, the standard says it might be in ro memory and it might not.
And it's a good idea to carve in stone what happens if you ask for a move.
but you can still return by const. it doesn't prevent rvo.
on the contrary.
 
Consider consumer( producer() ). if producer has const result, then consumer cannot modify that object. in particular, cannot just move over things
 
granted, for what i undertand there's an issue the rises because of the independent compilation rule.
consumer() can move if it takes a const.
that's rvo.
if it doesn't take a const then it can't. i don't see the problem here: you ask for const, you get const. it's just that in 0x we have a new concern, that of move. it doesn't eliminate the use of const return by value. only adds something new before making a decision.
 
2:37 AM
hm, i don't follow
 
and if for anyone returning by value implied returning a const by value then that's not the case any more. but that's it, for what i understand.
don't follow what? at which point?
consumer-producer thing?
 
i'm not really up on C++0x moving, but "consumer() can move if it takes a const."
can it?
Consider this example. Remove the const and it compiles with g++ using -std=c++0x. I probably missed an include for the move, but, it compiles without the const.
 
consumer() promises it won't change its parameter. producer() doesn't want anyone to change its return-value. So... they can work together, on the same RVO-treated object.
 
So, I added const to consumer param, and it compiled. Hm...
But does it really move things then, or does it simply copy?
 
I don't know. In 03 I think it might and might not. You can printf in cctor i suppose, to see.
 
2:48 AM
Checking...
I get a little less copying without having those `const`s around, so tentative conclusion, with the `const`s it compiles but yields plain copying
 
ah. i think that maybe the problem is in the independent compilation.
 
Yeah, the `const`s force copy construction in the consumer func. code here
@tina you there?
 
if you compile a.cc independently from b.cc, and in a.cc you place the return value in readonly memory then... there's a problem.. but i have no clue here. maybe its done at link-time ? :-S
 
@tina if so, take a look at the C++ tutorial at www.cplusplus.com
 
this is what happens when i'm too lazy to open a pdf file and search. no, sorry, ask the computer to search for me. :-S
 
2:59 AM
:-) i don't grok what you're saying, but it sounds like ok.
i'm off now
 
i'm saying if you have const A f(); defined in a.cc, and then you call it in b.cc ...
when you compile a.cc, does the compiler statically place a return value in readonly memory? i mean, if it's truly compile-time const?
mm. i guess i'm not clear ... :-S
 
uh, no
now i'm really off
cheers
 
cia
 
 
2 hours later…
5:24 AM
I discovered something incredible today: if I log out of Stack Overflow at work, my productivity goes through the roof.
2
 
5:58 AM
Whew!
Have I ever been doing some heavy C++ coding... :)
Neat C++ trick:
string example = "A long string that can be"
"broken into multiple lines";
Sure is handy for loooooong strings.
@tina: Do you mean overriding? (Or its proper name: 'overloading')
I really don't have much experience with overloading operators. (I've never really needed it.)
But yeah, my bad - overloading is different from overriding... I get mixed up every now and again.
Can you show us the context of the code?
 
7:07 AM
@sbi hopefully diagrams are clearer now :)
 
7:24 AM
@JohannesSchaublitb Nice answer to the sequence points / ub question.
I <3 ASCII art code diagrams though
 
@JamesMcNellis :-)
(re productivity)
 
7:48 AM
SO C++ book list. To find that list I typed "c++ book list" in the SO search field.
Bjarne Stroustrup's "Programming: principles and practice using C++" is recommended.
If you already know a bit of programming, then consider "Accelerated C++" by Andrew Koenig and (his wife) Barbara Moo.
Bjarne created the language, and Andrew penned the C++98 standard.
 
Ha ha ha... I didn't know they were married...
 
@James: I thought so? Lemme check on Facebook...
 
Yeah, you're right.
 
Yep, confirmed.
 
The things one learns in the C++->*Lounge
@AlfPSteinbach When you look him up on Facebook do you have to use Koenig lookup? :-D
 
7:54 AM
:) Well at least argument-dependent lookup.
 
8:10 AM
@JamesMcNellis LOL
 
sbi
8:42 AM
@JohannesSchaublitb How something like (E(i++, { S(increment, i) }) E(j++, { S(increment, j) })) could ever be considered "clearer" escapes me.
@JamesMcNellis He once had their wedding photos up on his bell labs homepage. Also, the back cover of Ruminations on C++ is kind of a give-away on the matter.
Barbara Moo used to be (I think) some kind of technical manager for the CFront crew.
 
user69820
@tina hey @tina where did you get this Archive class from? You've been wrestling with it for some time now
 
10:07 AM
class tina
{
makeNoSense();
askQuestions();
};
sup sbi
 
sbi
@Reno ???
 
you have a sweet reputation dude
 
 
3 hours later…
sbi
1:24 PM
When I look at this question stackoverflow.com/questions/2552839/…, it still lists "Neil Butterworth" as the last editor. Looking at its history, however, shows that as "anon".
 
user69820
1:47 PM
hey @sbi
 
user69820
1
Q: Expression in C++

Brendan JosephIn C++ there are expressions which look very ugly and bizarre. I was going through an article on a local community and found this expression i = (i, ++i,i) + i; there. Is it expression fine or does it have some kind of problem? i is of a primitive type.

 
user69820
I've been sitting here all day for one to come along
 
sbi
@oraclecertifiedprofessional You can count on it. :)
 
 
1 hour later…
3:14 PM
@sbi Apparently I'm just way out of the loop. Though, CFront was first released before I was born. :-P
 
sbi
3:36 PM
@JamesMcNellis Apparently, CFront 3.0.3 was released May 1994. I doubt you're that young. However, 1.0 was released almost 10 years before that. I was in my teens then, but what really hindered me from exploring C++ back then was the fact that I was on the wrong side of the Iron Curtain.
 
0
A: Getting a list of values from a map

DeadMGSure. std::list<B> list; std::for_each(myMap.begin(), myMap.end(), [&](const std::pair<const A, B>& ref) { list.push_back(ref.second); }); If you don't have a C++0x compiler, first you have my sympathies, and second, you will need to build a quick function object for th...

DeadMG said " Lambda support stopped having to be explicitly tagged when MSVC10 and GCC4.5 both support them"
true or false?
 
3:52 PM
Another question
The above question has 2 votes to close and a link to a dup post
IMO the accepted answer in the linked dup is not what i'd suggest doing
should i vote to close?
 
@JohnDibling False, IMO. I think it's perfectly acceptable to use widely supported C++0x features in non-explicitly-c++0x-tagged questions, but the answer should explicitly state that it is a C++0x feature.
And, if possible, if you give a C++0x answer and there's a comparable C++03 answer, you should give the C++03 answer too...
 
Agreed, and that it what my MO has been
 
As for the duplicate question, I think both the accepted answer and the next answer are very good. They give two clean options for solving the problem.
@sbi I'm not quite that young, no :-P. My first experience with C++ was in 1997 at a programming summer camp.
 
4:14 PM
I wet to CompuCamp in the early 80's, speaking of geek camps...
 
 
1 hour later…
5:24 PM
Latest feature-request :D
2
Q: Conversion from CW to non-CW state?

Prasoon SauravThe question is short and simple. Why can't Community Wiki posts be rolled back to non-Wiki state? P.S : Recently my post here was made CW so I was wondering if something like that(conversion from wiki to non-wiki state) could be implemented. Its merely a feature request.

 
5:36 PM
hi in windows we use WDK to develop driver in linux what?
anyone
 
@maysam: what?
also, this is the chat. programming questions should be posted to SO
 
yes
i need girlfriend
this is chat
 
6:22 PM
Example that rep points and answer acceptance by OP does not always work: for this question the OP accepts an answer but notes in comment that it doesn't solve the problem. Answer that most probably solves the problem gets 0 rep points.
 
@maysam :)
 
what this chat room is very static
why
:)
 
busy working
 
:)
 
People are indeed busy
 
6:31 PM
iam alone in home and not busy , what is your job , iam kernel developer
 
Im a placement student. Mainly front end web development
 
@Raynos can be friend? :)
iam a student
 
Hi all from Ukraine ) i am c++ developoer i can help to someone ))
 
ok you are c++ developer iam friend with Andriy Shevchenko :)
 
@maysam Yeah he was a good player ) But now he is old for football :)
 
6:45 PM
@maysam ... thats rude :)
 
hey guys -- I have an editor at Pearson looking for C++ experts to review a C++ book.. $75 per chapter honorarium
2
> My name is Carole Snyder and I’m the Associate Editor for Deitel publications at Pearson Education. I’m contacting you to see if you might be able to help me locate a C++ technical expert (preferably with a C++ Standards Committee affiliation, but not mandatory) to review C++ How to Program, 8e, by Paul and Harvey Deitel.
> The continued success of C++ is built on quality textbooks and education. The quality of our textbooks is largely dependent on reviews by pioneers on the forefront of the technology, instructors and industry professionals, so your feedback would be greatly appreciated.
> I expect the review to begin this week, so your prompt response would be appreciated. Please let me know if you are interested and I will send you additional information. The honorarium is $75 per chapter
Carole Snyder
Associate Editor
Pearson Education
One Lake Street
Upper Saddle River, NJ 07458
201.236.7688
carole.snyder@pearson.com
 
It's jeff. I feel blessed.
 
if anyone is interested, please contact her directly -- and say Stack Overflow sent you :)
 
@JeffAtwood are we supposed to place the banner at the end of the email as a signature?
 
it can't hurt :)
ok, I suck at C++ so I will leave now
8
carry on gentlemen
 
Ata
6:52 PM
hi
 
Good day.
 
7:11 PM
@JeffAtwood wait... your meant to be good at c++ to be here 0_o
 
What timing -- this weekend I'm leaving for six weeks in the Philipines...
 
7:47 PM
where you going in the Philipines?
 
when writing a wrapper class, is it better to use inheritance or composition for the class you're wrapping?
 
case in point?
 
depends both on class and your notion of "better"
@JeffAtwood First edition of Deitel and Deitel was reportedly quite good, later editions have had bad reviews, e.g. cs.technion.ac.il/users/yechiel/CS/BadBooksC+C++.html#DeitelCPP That author notes "And finally, the authors do not reply to e-mail sent to them, concerning the quality of the book. Makes one wonders ... "
 
8:04 PM
@JohnDibling I'm just wrapping the classes of a XML library for my project so they expose only the bits I need in the rest of my project
although I'm finding that to be a tougher challenge then at first expected
 
9:03 PM
Hi Alf (if you're still around)
A bit of nearly everywhere -- my wife's mother ran a travel agency before she retired, and she's set us up with a rather busy itinerary...
 
ahaha what's up?
hey how can i quickly see all "@JohannesSchaublitb" that arrived today while i was away?
 
@HJohannes: Dunno, maybe this?
 
12 hours ago, by sbi
@JohannesSchaublitb How something like (E(i++, { S(increment, i) }) E(j++, { S(increment, j) })) could ever be considered "clearer" escapes me.
@sbi oh that was a mistak. the parentheses around those shouldn't be there :)
it was my first try to do it without trees and ( ... ) -> (grouping horizontally) but that looked like lisp :)
so i abandoned that but forgot to remove them
@sbi hopefully the description of the notation used is generally understandable. if not i may need to try to rephrase it
 
sbi
9:35 PM
Got a problem here tonight:
0
Q: No Openid providers on login page with FF 3.6.12

sbiThis is what the SO login page looks like using IE8: This is what the same page looks like in FF 3.6.12: Of course, I have restarted FF, rebooted my computer, started FF in safe mode (all Add-ons disabled), tried IE in a FF tab (with IETab) and whatnot, each several times, spending...

Any ideas anyone?
<grumpy/>
 
9:49 PM
@sbi I googled it. It seems it has to do with FF refreshing from its cache. Clearing cache reportedly helps for first view (and then problem is back again, of course). One person reports that "Real Player Browsing Record Plugin 1.0" was culprit. Might be that or some other plugin, how about trying to disable them?
@sbi Also, another person reported McAfee security as culprit.
 
sbi
@Alf Wouldn't the cache be emptied for FF safe mode? (I have neither McAfee nor that plugin.)
Oh, and thanks for taking the trouble to look at this.
 
@sbi Yes, it would. If safe mode doesn't work then I don't know.
 
sbi
:(
 
10:09 PM
lisp, schmisp
that was completely out of context, wasnt it
 
lisp has sex pressions
can't have a word half-italic :(
 
so does assembler
 
@Alf aren't you a mod of comp.lang.c++.moderated?
 
sbi
@AlfPSteinbach Clearing the cahce did the trick! You're a star!
(See you all soon from my FF browser...)
 
@JerryCoffin Wish you a nice vacation, then. But t'was joke that fell flat. I linked to "rude placename" in Philipines (Anus in Philipines), intending to follow up with story about Microsoft suspending an XBox Live gamer because of the name of the place he lived (Fort Gay in West Virginia). But OK, it probably wouldn't have been funny anyhow. Was funny in original context... :-)
@JohannesSchaublitb Yes, and?
 
10:19 PM
@Alf just wondered. i saw a "[ ... aps]" and it sounded like your name
i think i remember some debate where you put some message about pointer to members and broken c++ type system that allows circumventing protected access mechanism. fun thread :)
Neil commented back then about it and alexandrescu thanked Neil =)
i really had no clue when i posted my DR about protected-circumvention that you posted that insightful comment some months ago :)
 
@JohannesSchaublitb oh, it's years ago
:-)
@JohnDibling The Windows API has COMMONCONTROLSEX (IIRC the name correctly) (it's for the common controls initialization function).
 
OH.MY.GOD.
somebody sue microsoft
 
10:40 PM
litb finish your thesis?
 
@AlfPSteinbach Yup -- I caught the place name. Our initial destination is somewhat south of the Anus, however. :-)
2
 
ROTFLMA :-)
 
i think you missed an O there
or maybe that was a very subtle joke
 
lol very subtle
 
11:01 PM
lol you might have too much time on your hands
 
sbi
@JohnDibling That's not mine. Someone sent me the link the other day and I found it in my browser's history.
 
Hell doesn't look so bad
 
It's a very small place, but popular with the tourists; they can say, "I've been to Hell and back again"
 
sbi
@AlfPSteinbach I've been not far from that once. Hiking in Trollheimen. Best holiday I ever head.
@Alf What's "hell" in Norwegian?
 
11:09 PM
@sbi depends. the placename is actually "Hell". in old norwegian (norrønt) hell was "hel" or "helheimen". modern norwegian it's "helvete". in passing, as far as i know the practice of testing alleged witches by throwing them naked and bound in the sea was only employed in northern norway. if survive, witch. if drown, oh dang.
 
sbi
@Alf I think that practice was very popular (except with the alleged witches, of course) all over Europe.
And thanks for that lesson. I thought that they would be close (it's "Hölle" in German), but...how do you say that...jei icke snake norsk?
 
and historically it's not so long ago. so, i think we're a bit arrogant denouncing some countries as backward. it's just a matter of some decades of catching up, i think.
"jeg snakker ikke norsk" pronounced "yay snaacker icke norsk"
roughly
 
sbi
@Alf Ah yeah, the "j" and "eg" messed me up completely. I remember that. ("Gjeitoost"?)
 
sbi
Anyway, I liked it a lot there. Had a whole week where we saw no human being, only sheep and reindeer.
And just about everyone spoke incredibly good English. (The only exception being a bunch of farmers in rural areas.)
Only it was very expensive for a pair of German students, even though we mostly slept in a tent and ate from our backpacks.
 
11:20 PM
@sbi Yeah. A pint of beer is about 50 kr cheap places in Oslo. That's about €10 or something. Goes up to 80 kr in central Oslo...
 
sbi
Beer? I didn't even think of it. :) Just the price of things like cheese was amazing to us. We started hiking with almost 30kg in my backpack, 25 in hers. After we'd eaten from it (plus incredibly amounts of mushrooms and blueberries) for two weeks, mine had little over 20kg, hers 15.
What's a kr in €, nowadays?
 
sbi
Ah, thanks. Puts that beer prices in perspective.
(Oh, sorry, I have only now seen that you already told the price in €.)
(What can i say? I'm still distracted by my browser's fail. Sorry.)
I can get 0.5l of beer in a pub here in Berlin starting from €2.50. That's hard to find, though. It's not too hard to find a place were you pay twice that.
Anyway, bed is calling. See you!
 
@alf i like the "assert(false); return 0;" bit in your tutorial
i have such asserts in my code and intel compiler screams to me "expression constant" shit :)
it must be at least 50+ warnings for each of my littl assert(false) and assert(cond && "message") things :)
 
11:36 PM
@johannes: i can't remember, but, does the intel compiler complain about "assert(false)"?
 
At a high enough warning level, the Intel compiler complains if the storage class specifier isn't the very first thing in a declaration.
 
@alf it complains about all sorts of asserts in my code. i will check tomorrow whether it only complains about the string thing or also about plain (false)
 
11:51 PM
@JohannesSchaublitb Possibly you can avoid the warnings by obfuscating the constancy of your constants, like, a function obfuscatedFalse. At least, that works with g++ and msvc in some cases.
 
2
Q: Does D have something akin to C++0x's move semantics?

FredOverflowA problem of "value types" with external resources (like std::vector<T> or std::string) is that copying them tends to be quite expensive, and copies are created implicitly in various contexts, so this tends to be a performance concern. C++0x's answer to this problem is move semantics, which...

any takers? :)
 

« first day (31 days earlier)      last day (4911 days later) »