« first day (36 days earlier)      last day (4920 days later) » 
00:00 - 22:0022:00 - 00:00

10:00 PM
@JohannesSchaublitb I'll insert the necessary stuff and you tell me what you think, okay?
 
lol alright
altho he said "this implementation is incomplete and only for illustration". tho that looks like "i omitted some functions like getFileHandle" :)
 
sbi
@JohannesSchaublitb There's more to this than rep-whoring. Technically, if you write up an FAQ question that's already been asked, it should be closed as a dupe.
 
@sbi yes for sure
so what is needed is a clear set of rules what the C++ FAQ should should be and how to add answers / questions and how to "hijack" questions
 
@JohannesSchaublitb Done. Note how I also changed the line that created the temporary objects. We don't even need the move operations anymore in this example :)
Note it relies on the FileHandle constructor to be implicit, which may not be a good guideline.
 
note that this relies on c++0x, for which the const ref example would have worked too (c++0x directly binds temporaries to const refs)
 
sbi
10:15 PM

FAQ thought #1

yesterday, 2 minutes total – 4 messages, 2 users, 0 stars

Bookmarked yesterday by sbi

 
@Fred i think if you would disable the move ctor then that example passing string literals would be illformed :)
 
@JohannesSchaublitb Maybe, I'm not sure about that.
But I don't think so, actually.
 
you need if(file) fclose(file); in the dtor :)
 
Because the formal parameter is initialized directly, not by copy.
@JohannesSchaublitb Oh, is fclose so stupid? Damn. Ich bin zu verwöhnt von delete :-)
 
@Fred saying A a = "foo"; first creates a temporary A object and then direct initializes the destination (a) with that temporary
 
10:18 PM
@JohannesSchaublitb Damn, you're right of course.
 
@Fred argument passing involves copy initialization
:)
 
Do you have any source that claims fclose(0) is ill-formed? Just to be sure...
 
my manpage doesn't mention that null pointers are allowed
i remember i've had to handle this earlier, too, when i tried to create a shared_ptr<FILE> p(fopen(...), &fclose); :)
 
@JohannesSchaublitb OK, but it was you who caught it, I think you should have the honor of editing it in ;)
If you don't mind, that is. Otherwise, I'll do it.
 
@Fred i'm not sure of the value of doing that move constructor stuff at all in the first place :) because it will require c++0x, for which no work around is needed to the code that peterchen was using (after his edit where he used FileHandle const& as parameters). Only for C++03 it makes problems.
So now people of the C# camp who want to just know about RAII need to also know about rvalue references. :)
 
10:25 PM
But what can you do with a const FileHandle&, you certainly cannot write to it, right?
 
@Fred so i would rather like to leave the fixing up to you haha
@Fred haha that's a good point xD
 
damn, there's always a catch...
 
aww with two more edits his answer becomes community wiki lol
 
@JohannesSchaublitb Done. This answer is completely C++0x-ified...
Maybe I should have edited "overly simplistic" out? :)
 
10:35 PM
@JohannesSchaublitb Anyway, please look carefully over the code if I did any mistakes, I didn't compile this or anything.
 
It could have worked if the function took FILE* and at the call they would just do CopyFileData(FileHandle("foo.txt").getHandle(), FileHandle("bar.txt").getFileHandle()); magic, no copies
and getHandle would just return the FILE* :)
 
Feel free to edit, I think I raped the answer enough :)
 
Either of you two know objective-c?
 
@sadmicrowave Nope, of the languages starting or ending on the letter C, I know only C++.
 
Johannes?
 
10:37 PM
lol
 
dunno of objc
 
Oh wait, does Cobol count? :)
 
i better not touch it now. it will become CW
 
Or Basic? :)
 
10:38 PM
no those don't count lol - alright thanks guys - sorry to interrupt
 
sbi
@FredOverflow Count against what?
 
you can ask on meta who knows it
 
@JohannesSchaublitb What if I roll my changes back? Will that also reset the edit counter?
 
meta is about people on SO. i think that question should count xD
@Fred i've no idea :/
 
@sbi Does Cobol count as a language "starting or ending on the letter C".
 
10:39 PM
thanks guys
 
sbi
@FredOverflow Ah, I overlooked that.
Didn't they (in the 90ies) also invent an object-oriented COBOL? (And wouldn't that then have to be named COOBOL?)
 
How does a post become a Community Wiki post?
The body of the post has been edited by at least five (5) different users
The post has been edited ten (10) times **by the original owner**
 
Damnit why doesn't this work`?
 
10:41 PM
So I think we're safe!
 
test in a nutshell
weird
 
Must be a multiline letdown
 
sbi
@FredOverflow Look to the right of your browser window. There's a bold statement with a link. Click on it. Read. Understand.
 
if i change it to FILE* he will say "hey now you are passing ugly RAW POINTERZ!"
lol
 
@JohannesSchaublitb Who is "he"?
 
sbi
10:42 PM
In short: It's considered a feature by those who brought it upon us:
 
sbi
2
Q: Markdown in chat fails for multi-line messages

sbiWe've come to rename Markdown to Letdown in the C++ chat room because it lets you down so often. I've now just found a pattern. It seems markdown fails for multi-line messages. That is, this Letdown can't cope with multi-line comments. Let's see code? fails to display code marked as co...

 
Anyway, the class definitely needs some way of getting to the raw pointer, otherwise the handle is completely useless
 
sbi
Ok, I'm bowing out. G'night.
 
10:43 PM
actually if the class is called "FooHandle" and it has a problem with being copied, it's a very broken Handle
 
damnit almost midnight
 
what did i do all day??
 
FileGuard maybe?
dammit i still need to get to my thesis lol
 
I think Handle is ok.
Or just... File?
Maybe we should roll all this crap back and start our own answer :) Mit Black Jack und Nutten :)
 
10:44 PM
i really think that if you pass the FILE* it would be way clearer and could avoid the copy issue.
 
Yeah, sounds like a good idea to me. Go ahead!
 
lol @ Black Jack
 
sbi
@FredOverflow I'd happily invite you to hijack this: stackoverflow.com/questions/2321511/…
 
i see peterchen scream "what did you do to my littl answer!"
 
sbi
Should I make it CW before I go to bed?
 
10:46 PM
@sbi no, that can wait :)
 
some in ##c++ call it "SBRM"
 
@JohannesSchaublitb Well, he can always roll everything back if he wants to...
damnit i need to go to the toilet really bad.
 
Ah, sometimes leaking resources is a good thing! Now where were we...
 
so should i mess with the answer too and make it c++03 again? you put so much love into it...
lol
 
10:53 PM
Hm, honestly, I like the answer as it is right now. The "messy details" are nicely hidden for those who don't need to know about them.
 
i see :) so i won't touch anything haha
 
But what I would really like to do is nuke every question that is marked RAII and start from scratch with a nice FAQ :)
("first asked question"? lol)
 
Guys, anyone knows some place where i can ask a openGL + c++ question, and get fast, well-formed and wise answers? :D
 
why don't we nuke c++ and start with a nice language from scratch? lol
 
10:55 PM
haha
 
not extreme fast though
but usually very nice
and thorough
 
0
A: Setting up a FAQ for the C++ tag

jalfAs I've said in a few comments on [c++-faq] questions a few days ago, I feel that this is circumvents most of what makes StackOverflow work. We've always had the ability to give "RTFM" answers. Direct people to the C++ FAQ Lite, a good book or whatever else floats your boat. And the problem has ...

 
> It would be great if there was a convenient way to make the good versions of commonly asked questions easily accessible, but this tag is rapidly devolving into experts jerking off with their experts knowledge, rather than actual beginners getting answers to their beginners questions.
LOL
 
@FredOverflow thanks, i'll try it. I posted my question to SO also, but i dont see it in my profile. Its weird. Although it's acessible via url, and someone even answered to it, whats wrong with my profile >_<
 
@FredOverflow i think he has some good points :)
 
11:05 PM
@Anton You probably didn't sort by "newest"
 
SO doesn't seem to be suited for having a wiki somehow "embedded" in it :)
 
@JohannesSchaublitb Yeah, maybe we really should stop masturbating and write a book or something.
Oh wait, Effective C++ already exists!
:-(
 
I think the real problem is that good C++ programmers tend to be perfectionists who don't want to see half-assed answers. They want to talk about every little detail and get it right.
 
"A beginner is going to have to parse a lot of standardese in order to get his question answered." exactly, i find that a problem with my typename thing too. i think i should remove the quotes. i will do so soon
 
11:08 PM
@FredOverflow yes. Yes, i didnt :D This night programming drives me dumb.
 
so his complaint doesn't apply to my answer haha!
 
@JohannesSchaublitb What do you mean?
 
11:23 PM
@FredOverflow i've done a comment on his answer :)
 
> I'm starting to believe that C++-faq is maybe the wrong way to solve the problem.
How big is the problem, actually? Were there really any other topics besides `i++ + ++i` that occurred so frequently it became annoying? I never stopped to ask this question, I was too busy "masturbating" :)
 
typename at least occured as frequently if not more frequent i think
i wonder to what "always the same four ..." he refers :)
i guess he means sbi, fred, prasoon and litb -.-
 
> I know I feel demotivated when I look at the list of recent C++ answers and see that a number of them are asked by the same four expert users.
Wow, we can ask answers on SO? Didn't know that.
I guess he means questions?
 
11:38 PM
lol
 
Well, I have three questions in the C++ FAQ, is that already too much?
 
i've one q and 2 answers haha
 
He must be referring to someone else
Looking at the current FAQ list, I wonder if we should remove the closed "How do I make a program from my C++ code?" question...
Has anyone ever asked this?
Oh boy do I love this comment on the main question: "I've never seen an IDE that completely answers all those questions - does yours tell you about the history of the language? If so, please share!"
 
11:53 PM
why so quiet @tina ?
 
i've just done so
1
Q: Where to put the "template" and "typename" on dependent names

MSaltersI implemented a "discriminated union" capable of holding C++ types, even if they have destructors etc. I implemented this as a Russian doll; i.e. Union<T1, T2, T3> derives from unionNode<T1, <UnionNode<T2, UnionNode<T3, void> > > and UnionNode<T, Tail> derives fro...

 
@JohannesSchaublitb awesome!
will upvote in 2 minutes :)
is your faq completely removed? is that possible?
 
@Fred yes i deleted it
 
@tina Well, I define "quiet" as "joining but not saying anything"... ;)
 
00:00 - 22:0022:00 - 00:00

« first day (36 days earlier)      last day (4920 days later) »