« first day (28 days earlier)      last day (4903 days later) » 

3:00 PM
@tina yes I know, but you have also asked question here a lot. Its fine to ask relatively small questions or to think out loud, which is what you are doing sometimes, but you are also asking fairly big questions that are hard to answear properly in chat
 
@sbi ohh thanks!
 
sbi
BTW, *some advice for newcomers* here:
You can edit your messages for 2mins. Try the `v` arrow to the left of it. You can edit your last messages using `cursor up`, `escape` cancels this.
Markdown sort of works here, but we've come to rename it as Letdown, because it's pretty buggy.
Links to a few sites (all SE site, Wikipedia, Twitter etc.) will inline an excerpt of the page linked to, when they are the only text in a message.
Reply to others using the familiar @syntax. Reply to specific messages by clicking on the little down-right arrow appearing at its very right when you hover over it.
2
@sbi (Disregard this, I'm just trying to get a newbie-FAQ-like thing pinned on the right-hand pane.)
 
can some one explain how this @ system is implemented... mainly how I am getting @ed with things that are barley my name
 
sbi
@tina From what I have seen Alf has spend hours of his personal sleeping time discussing things with you. Given your incredible spelling and your really vague and unformulated questions that strikes me as very patient.
@the If it's like in SO comments, the first three letters suffice.
Yep, works.
 
@sbi ¬_¬
 
3:06 PM
so Alf was getting frustrated about tina?
yeah, girls can be difficult...
 
sbi
@JohannesSchaublitb I don't even think he expressed frustration at any point. From what I've seen he's been incredible patient.
 
@JohannesSchaublitb quite to opposite I think
 
oh
alf has written a nice pointer tutorial about 100 pages or such
 
Hate to sound bitchy... but prime example of the way poor grammar can be taken very badly
@JohannesSchaublitb link plz
 
sbi
@JohannesSchaublitb Yeah like Langer, Moo, Ellis and all the other, erm, girlish girls in the C++ community. Oh, wait...
 
3:09 PM
lol
 
sbi
@thecoshman What are you referring to? (Furriner wants to know.)
 
@sbi "k now stop talking and good night"
 
sbi
@thecoshman Oh, and while we're at revealing secrets: What keyboard do you make those with?
@the Ah, tina? (I'm back to blocking her.)
 
@sbi erm... on a standard UK ketboard, next to eh one above the tab, shift that key. then an underscore then again with the grave, I think it is called
 
sbi
@the Ah, UK keyboard. Mine has ^ and ° above the tab.
 
3:13 PM
best ask him about it xD
having geordi in here would really rock btw: xs4all.nl/~weegen/eelis/geordi
 
for me ^ is about the 6 and I have no degree symbol key
 
sbi
Oh, I guess Fred has punished me (for criticizing him) by accepting my answer instead of his. :)
6
A: What is the rule of three?

sbiThe Rule of Three is a rule of thumb for C++, basically saying If your class needs either a copy constructor, an assignment operator, or a destructor, then it is likely to need all three of them. The reasons for this is that all three of them are usually used to manag...

@sbi English grammar is ambiguous. I had to go and fix that sentence.
 
sbi
Wow, they even have a history for edited chat messages!
Ah, those don't inline. Not bad.
 
@sbi your not English then?
 
sbi
3:18 PM
@the Nay.
sbi, Berlin, Germany
38.2k 2 34 99
 
haha he's german
 
sbi
@sbi See, says there, loud and clear.
 
@sbi and instantly John Cleeves jumps to mind
 
how can you put your "signature" like that?
 
sbi
18 mins ago, by sbi
BTW, *some advice for newcomers* here:
You can edit your messages for 2mins. Try the `v` arrow to the left of it. You can edit your last messages using `cursor up`, `escape` cancels this.
Markdown sort of works here, but we've come to rename it as Letdown, because it's pretty buggy.
Links to a few sites (all SE site, Wikipedia, Twitter etc.) will inline an excerpt of the page linked to, when they are the only text in a message.
Reply to others using the familiar @syntax. Reply to specific messages by clicking on the little down-right arrow appearing at its very right when you hover over it.
(Put the link into its own message.)
 
sbi
Sometimes I wish we could down-vote comments. Space Cowboy is flat put wrong at stackoverflow.com/questions/4172722/what-is-the-rule-of-three/…
 
sbi
Quick learner! (but we all knew that already, of course.)
 
lol
how does it pick all those badges?
 
@JohannesSchaublitb I like your C++ templates gold batch. I wanna steal it :P :P
 
3:22 PM
lol
it's mine :DD
 
sbi
@Johannes Know that your profile was posted here like this just yesterday. Only the name was different.
22 hours ago, by James McNellis
 
sbi
We all had a good snicker out of this one. :)
 
sbi
3:24 PM
See, even youtube!
 
Hey how are you guys posting links like these..? It seems I have missed something.
 
dam it! how do you do that :(
 
@thecoshman : Hehe I have the same question.
 
3:25 PM
http://www.youtube.com/watch?v=7xnNhzgcWTk
like that...?
 
hey it works
 
sbi
@Prasoon Just put them into a message of its own. For some sites, the chat will inline them.
 
god dam it!
yay!
 
i wonder whether it inlines ideone or codepad urls
 
christ that was more effort then it was worth I am sure
 
sbi
3:26 PM
(And if you look at the right side of your browser window, you see this FAQ posting of mine:
24 mins ago, by sbi
BTW, *some advice for newcomers* here:
You can edit your messages for 2mins. Try the `v` arrow to the left of it. You can edit your last messages using `cursor up`, `escape` cancels this.
Markdown sort of works here, but we've come to rename it as Letdown, because it's pretty buggy.
Links to a few sites (all SE site, Wikipedia, Twitter etc.) will inline an excerpt of the page linked to, when they are the only text in a message.
Reply to others using the familiar @syntax. Reply to specific messages by clicking on the little down-right arrow appearing at its very right when you hover over it.
 
hm prolly not a good idea tho
 
sbi
explaining this and other things.)
 
@JohannesSchaublitb would defeat the idea of posting code there in the first place
 
sbi
@JohannesSchaublitb No it doesn't. That why Roger's message is pinned to the right, too.
19 hours ago, by Roger Pate
Don't be vague, be an ace; write a proper test-case! Paste at http://codepad.org/, http://ideone.com/, or here (if short).
Wouldn't make much sense to use them instead of pasting the code here, if they were inlined, too.
 
it could show "compiled / errored out with '..'" in addition. but i guess most code is too long..
 
3:28 PM
I haven't still got it. Shame on me.. :(
 
@Prasoon you need to do it with an explicit instantiation
 
sbi
@Prasoon Into your next message, put nothing but this link: http://stackoverflow.com/q/4172722/140719
 
sbi
Congrats! Dancing rodents! Prasoon made it! Let's invent a badge for this!
 
rule-of-three is: Have three tags in the rule-of-three question!
 
3:30 PM
Haha!! A shamy-student badge ;)
 
sbi
@JohannesSchaublitb Wow, I didn't know there was a rule-of-three tag! (Likely pushing Letdown beyond its limits here.)
I don't get it, this works!
 
sbi
I mean, this was code within an inlined link in a reply!
 
sbi
Seems tag wikis don't work.
Quite arbitrary, this.
@Prasoon If you click on the v to the left of a specific message, you get a permanent link. Post this in its own message.
Oh, and no history for deleted messages. :)
 
3:36 PM
Yay!!
 
sbi
Here comes another FAQ entry!
 
sbi
1
Q: what is curiously recurring template pattern?

AlsCan anyone please provide a good explanation for CRTP with an code example? Please do not ask me to refer a book, I already do have the books and refer them but I usually find the explanations/examples that you guys come up with at SO much more suitable and practical in understanding the concept ...

:)
(Now everybody rushed to the question, and I'll be totally alone here, playing cat-out-of-house mouse games.)
 
Yeah. wikipedia has the necessary information though but still thats a c++-faq.
 
@sbi really want to tell him to refer to a book
 
sbi
3:38 PM
@PrasoonSaurav Oops, you here! Caught me with my hand in the cookie jar! <blush>
@thecoshman I don't think there's many books that explain the CRTP.
Besides it's SO's goal to be what google points you at when you ask it for CRTP.
 
@sbi I am sure it not complex enough to warrant a full book on it, but their must be books that do cover it
 
@sbi Yeah. Sure but I am in a different time-zone(so you wont be alone). GMT +5.30
;)
 
you know, me and a friend once sat down and defined a base 42 number system... needless to say we never got around to making use of it, but we defined it nun the less
 
@sbi Good one! It seems somebody has answered it.
 
sbi
@PrasoonSaurav Yeah, I know about your timezone, but I thought everybody rushed away to earn rep on such a simple question.
Ha, answered that here days ago:
Oct 28 at 22:11, by sbi
The rule of three (also known as the Law of The Big Three or The Big Three) is a rule of thumb in C++ that claims that if a class defines one of the following it should probably explicitly define all three: *destructor *copy constructor *copy assignment operator These three functions are special member functions that are automatically created by the compiler if they are not explicitly declared by the programmer. If one of these had to be defined by the programmer, it means that the compiler-generated version does not fit the needs of the class in one case and it will probably not fit in t...
@sbi I liked this one:
Oct 30 at 22:00, by sbi
Oh, and don't bother going to the new question that's just popped up atop of your browser's tab hosting this chat. I',m already harvesting rep on it. :)
 
3:45 PM
@sbi : Talking of earning reps. How could this answer generate 120 reps.
12
A: Interview question - Search in sorted array X for index i such that X[i] = i

codaddictThis can be done in O(logN) time and O(1) space. Consider a new array Y such that Y[i] = X[i] - i Array X : -3 -1 0 3 5 7 index : 0 1 2 3 4 5 Array Y : -3 -2 -2 0 1 2 Since the elements in X are in increasing order, the elements in the new array Y will be in non-decreasing o...

 
sbi
Yeah, it's own line isn't enough. needs to be its own message.
 
Yeah already did it.
@JohannesSchaublitb : I wasn't shocked because the answer was posted by Johannes Schaub.
19
A: const and STL containers

Prasoon SauravYour STL container elements should be assignable and copy-constructible. const prevents it from being assignable. Remove const and try compiling your code again. Also change std::vector<double> VectDouble::iterator to std::vector<double>::iterator

 
sbi
See, Armen answered the CRTP question:
1
A: what is curiously recurring template pattern?

Armen TsirunyanIn short, CRTP is when a class A has a base class which is a template specialization for the class A itself. E.g. template <class T> class X{...}; class A : public X<A> {...}; It is curiously recurring, isn't it? :) Now, what does this give you? This actually gives the X template ...

 
i was shocked when this simple answer generated 790 rep: stackoverflow.com/questions/646169/…
79
A: Changing c++ output without changing the main() function

Johannes Schaub - litbOk, fixing your main function and iostream.h ... This is the way #include <iostream> // to make sure std::cout is constructed when we use it // before main was called - thxx to @chappar std::ios_base::Init stream_initializer; struct caller { caller() { std::cout << "I "; } ...

 
sbi
@JohannesSchaublitb Now whose dick is longer?
 
3:49 PM
lol
 
@JohannesSchaublitb I wasn't shocked because the answer was Johannes Schaub's.
;)
@sbi LMAO!
 
i don't understand the dick thing
 
sbi
@JohannesSchaublitb "Schwanzvergleich"
 
i mean i understand what it translates to but i don't see why it is funny lol
 
@JohannesSchaublitb @sbi : You know what people just love you both. Even a simpler answer of yours can generate a much higher rep. :-) That's what I feel.
 
sbi
3:52 PM
Can everybody who has starred chat.stackoverflow.com/transcript/message/108822#108822, please un-star it? (You can do this at the right, by clicking on the yellow star.) I have posted a revised revision since. That's already pinned to the right, but if you want, you can still star it.
@sbi Forget about it.
Room ownership comes with power.
:)
@PrasoonSaurav Is that true? I had never thought people would up-vote me just for my name.
 
@sbi I wouldn't :P
 
i should replace my pic with something else and change my nick and then look
 
Its 60% your name + 40% the quality of your answers
 
that only counts for the people who don't understand anything
 
3:56 PM
Believe it or not it matters. Ask anyone from the C# tag they like worship Jon Skeet.
 
people who actually read and understand things won't upvote a wrong answer, i hope
 
@PrasoonSaurav surely answer should be anonymous, as it should be based purely on the quality of the answer. who wrote it shouldn't matter
 
yes, sadly there seems to be some folks who just go by the comments or by a person's rep. if a comment says "your answer is wrong.. etc" then some people just downvote it.
 
@JohannesSchaublitb : Yes I completely agree with your point. I would never upvote a wrong answer but there are other members too who would just upvote a person with a much higher rep.
@thecoshman Yes. Right.
 
obfuscation!
 
3:59 PM
so try and get some rep and people will accept yours too xD
 
:D
@sbi But they do. ;-)
 
@JohannesSchaublitb ¬_¬
 
179
A: Should one use < or <= in a for loop

Jon SkeetThe first is more idiomatic. In particular, it indicates (in a 0-based sense) the number of iterations. When using something 1-based (e.g. JDBC, IIRC) I might be tempted to use <=. So: for (int i=0; i < count; i++) // For 0-based APIs for (int i=1; i <= count; i++) // For 1-based APIs ...

 
i will try next time on a community wiki question and post a totally retarted answer that sounds right. let's see what happens
 
This generated 1790 reps.
 
sbi
4:02 PM
I'm absolutely flattered. I didn't think of myself as a SO celebrity.
Now as for Jon and Johannes... `:)`
 
yes, i'm just a annoying nerd. people don't really like me
 
sbi
Ugh, I guess I see a pattern here.
Letdown can't cope with multi-line comments. Let's see `code`?
 
@JohannesSchaublitb At least 5 guys will upvote it. I am pretty sure. ;-)
 
sbi
But code works.
Ha, halfway to a bug report here!
 
4:04 PM
@JohannesSchaublitb Haha! Thats one of the biggest jokes that I have heard today. People don't like you? Seriously?
 
there should be stackexchange-global badges imho
 
sbi
@JohannesSchaublitb Try it on stackoverflow.com/questions/4173343/…
 
for example a [bugger] badge for people that reported a certain amount of bugs that got fixed
@sbi you will know then. i must do it hidden so noone knows about my plan xD
 
11 hours ago, by James McNellis
@ShekharGupta I was going to say "people like Johannes 'The Walking C++ Standard' Schaub," but...
How about this comment by James McNellis? ;-)
11 hours ago, by wilhelmtell
LOL yeah litb is arguably the tag's king.
 
sbi
Wow, I just mistyped "markdown" as "morkdown". That's almost better than "letdown".
 
4:07 PM
ohh!
people exaggerate, naturally
 
sbi
Prasoon Don't get too obsessed about it. You rose like a star in the c++ tag, amassing incredible amounts of rep in not even half a year.
 
There's another.
11 hours ago, by Shekhar Gupta
@JamesMcNellis yes he too. It seems he has memorized the C++ standard.
 
sbi
(BTW, I'm not concerned about James saying this, since he would be very quick to point out errors.)
 
dammit i wanted to clean my room and now i'm at SO again xD
 
@sbi But I just pointed out how a simple answer could generate so much reps. Most of the answers that I have given are to very simple questions.
 
4:10 PM
@Prasoon yeah i noticed you are growing to the sequence point guy
 
Lolz :-) I like sequence points but this room says "No undefined behavior allowed." :P :P
 
sbi
On SO, there is reputation accounted for, expressed in numbers on your profile page, and reputation unaccounted for, which you only earn because people start to recognize your name, since they have seen it with so many good answers. SO really managed to get a strong correlation between the two, but they're not fully congruent. The informal one just takes time. You, as a rising star, didn't have much time yet.
It took me a year to get as much rep as you got in four months. When I was where you are now, I not only had little informal rep, I also had much less accounted-for.
So there's no need for you to whine at all. :)
 
@sbi: Ohkk..Never mind. I have also seen answers containing quotes from the Standards getting higher number of upvotes in general.
 
sbi
@PrasoonSaurav Yep, that's true. For one, I often up-vote citing answers. I envy everyone who can read it and find useful information in it.
 
4:16 PM
:-)
 
sbi
@JohannesSchaublitb What are you complaining about?! I wanted to buy groceries, and now I spent most of the day here...
 
Haha!
@AlfPSteinbach is here too. Hii Alf. :)
 
11 hours ago, by Roger Pate
litb only got SO rep because he abandoned us
that's not true :(
 
@Johannes: could you take a look at this question about SFINAE, please?
Hi Prasoon! :)
 
4:19 PM
@AlfPSteinbach Tina missed you so much. :P
2
 
@Johannes: that's the channel where they always tell you you're not actually using C++? :P
 
@Johannes: I'm stumped, you see. Also, there's conflict of interest, so to speak. I've had to reject some articles about this question purely on form, like article starting with "Therefore ...". Not for me to come up with solution. Would at very least look sort of suspicious to person who wrote those articles.
 
@Alf the same code was given to comp.lang.c++ i think a couple days ago
@Alf it looks like GCC is wrong on that.
 
4:22 PM
@Johannes: yes, and clc++m.
 
oh i see
@Alf "you're trying to use the result of operator& in a constant-expression context,
and that is prohibited. " that sounds wrong to me
 
sbi
@PrasoonSaurav Wow, and I don't have any stars left for today!
 
@sbi ROFLMAO ;-)
 
sbi
Ha, being a room owner has advantages. (Where have I heard this today?) I just pinned it. :)
 
@Johannes: yes (you're quoting Andy), I couldn't quite figure that out. Closest I got was 5.19/4 that address of member of non-POD is not address constant expression.
 
sbi
4:27 PM
Hi @Fred!
 
the form allowed for use by a non-type template argument is "a pointer to member expressed as described in 5.3.1"
 
sbi
Fred?
 
Probably you should try @FredOverflow .
 
sbi
1 min ago, by sbi
Hi @Fred!
@Prasoon :)
 
@sbi Oh edited! :P
 
sbi
4:30 PM
I'm a furious editor. I rarely ever get a comment right the first time.
 
hello there
 
so you just need to look at 5.3.1 and find that it allows & qualified-id , and that it delegates to 13.4 for figuring out the correct address (since templates are treated as a set of overloaded functions)
 
hope you enjoy my answer about the rule of three ;)
 
13.4 has as one possible target "a non-type template-parameter"
 
sbi
1 hour ago, by sbi
Oh, I guess Fred has punished me (for criticizing him) by accepting my answer instead of his. :)
Yes, we did.
 
4:31 PM
@FredOverflow Nice long answer. Good!
 
Au contrair, I hope you will edit your answer to fill it with even more useful information.
 
@Johannes: that's §5.3.1/3, talking about & qualified-id. Do you think referring to a member template is not a qualified-id?
 
Plus, accepting my own answer would be strange...
 
@Alf 5.19/4 does not apply. 5.19/6 applies
@Alf it is still a qualified-id . it's a nested name specifier followed by a template-id (the unqualified-id part)
 
sbi, I was going to suggest you write a FAQ about the difference between declaration and definition, but then I saw it already existed :(
 
4:33 PM
@FredOverflow Guys do that. :-)
 
@Parsoon: Well, maybe I'll change my mind tomorrow :)
What are the next pressing C++ FAQs that need to be addressed?
 
@Alf well, if you say &Class::memberTemplate<Foo> i tis. but if you say foo.memberTemplate<Foo> it isn't (just to clarify)
 
Do we even need to talk about C++0x in FAQs if they are primarily designed for newbies?
 
@FredOverflow Ohh typo. Prasoon is different from Parsoon. ;-)
 
sbi
@FredOverflow Did that refer to me quoting an earlier message of mine?
 
4:35 PM
@Johannes: right, that's 5.1/7, methinks. and so the code seems to be OK?
 
Yes, that's when I noticed. But I thought of asking you a couple of hours earlier.
 
sbi
@FredOverflow Yeah, been harvesting rep from this one forever. :) The link today earned me another one so far.
 
@Alf yes the code looks correct. In fact, clang has no problems with it either
 
BTW did you guys read about this? cpp-next.com/archive/2010/10/implicit-move-must-go
It says move operations should NOT be generated automatically.
Because it can lead to bugs.
 
sbi
@FredOverflow If you feel like crossing GMan, have a look at his answer on meta:
9
A: Setting up a FAQ for the C++ tag

GManIdeas for C++-FAQ Questions might be: How do I learn C++? What if I know another language? What resources should I use? Close to my heart. State my profile in a far nicer manner, explaining rationale possible "meta" tips about learning (how to avoid thinking in other languages, why not to, how...

 
4:37 PM
@sbi: What does "crossing" mean in this context? Sorry, English is not my native language.
 
Ohh hard words from @AlfPSteinbach here.
 
@sbi: That upvote was actually me :)
 
sbi
@FredOverflow However, it seems Dave didn't win them all for his side of the argument:
2 hours ago, by sbi
Looks like implicit move is here to stay, folks, with some tighter restrictions for when it gets generated. #cpp #wg21
@FredOverflow "verärgern"? (dict.leo.org/?search=cross)
 
This is a very similar one:
19
A: Is it possible to write a C++ template to check for a function's existence?

Johannes Schaub - litbC++ allows SFINAE to be used for this: #define HAS_MEM_FUNC(func, name) \ template<typename T, typename Sign> \ struct name { \ template <typename...

@Alf ^^
 
@sbi: Ah, you mean by "stealing" his ideas for further FAQs? :)
 
sbi
4:41 PM
@Fred Yep.
 
@Johannes: PLEASE do a FAQ about sequence points and what changed in C++0x!
 
sbi
@FredOverflow But since GMan lately hasn't been doing anything in this regard, I think this would be Ok.
 
That would be awesome
 
i'm a noob on that, sorry. haven't got any clue on how all this thread things work in c++0x
 
sbi
@FredOverflow Hadn't we just established that Prasoon should do the sequence point one? :)
@Prasoon Go for it, it'll make you immortal!
 
4:42 PM
people will like you
 
@JohannesSchaublitb =)
 
@Prasoon: yes, harsh words. it's telling that Dave responds by personal comment ("when you don't understand"). t'was all political
 
sbi
@FredOverflow (Oh, and I have no idea which up-vote you're referring to.)
 
Well, if @Prasoon is the guy, let him do it. But I want that FAQ :)
 
@sbi Yeah sure. I will. :)
 
sbi
4:43 PM
@PrasoonSaurav Now?
 
@sbi: I voted your answer on stackoverflow.com/questions/1410563 from 29 to 30 today :)
 
sbi
@Fred Ah, that one. Sorry for being so dense. That should have been obvious.
 
No not now. Probably tomorrow :) But C++0x stuffs to be added by Johannes. :)
 
i somewhat agree with @Alf's rant. throwing move ops seem weird to me
 
@Prasoon: i think it was herd instinct going again. Bjarne set directions in a paper that was pretty good, but failed to look closely enough at technical issue, as I recall.
@Prasoon: then Dave Abrahams and Doug Gregor noted in a paper that hey, throwing move ops are not-so-compatible with e.g. reallocation for std::vector.
 
4:45 PM
May @Alf could write a "how does standardization of C++ work" faq? :)
 
sbi
@Fred, BTW, there's a message from me pinned to the right, explaining a few beginner's things here in the chat. (I'm not sure whether you have been here before, so please don't be offended if that's the case.) You might be interested in that.
 
Why do you guys have to say about this? @Alf once said that David is giving some bad advice there (and I support him) as I recall.
 
@Fred I always enjoy confusing people by asking whether template<typename T> Int i; would be valid
 
@sbi: this is my first time here
 
@Prasson: then Dave Abrahams apparently changed view
 
sbi
4:47 PM
@FredOverflow See the message? It starts with "BTW, some advice...". If you click on the link that comes with the time it was posted, you see it in full.
@JohannesSchaublitb Would it?
 
@sbi haha that's the question
 
sbi
@Johannes I did get that this is a question. I'm not that dense.
But what's the answer (and version of the standard)?
 
@sbi ah cool :)
 
@sbi it's working in all Standards so far. you are allowed to put any code around that declaration, if you like to make it valid (macros are not allowed)
 
What do you guys have to say about this? @Alf once said that David is giving some bad advice there (and I supported him) as I recall.
 
4:49 PM
@sbi it actually is valid
 
sbi
@JohannesSchaublitb But what is it??
BTW, filed a bug for Letdown:
1
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...

 
@sbi it can be a function template declaration
 
@prasoon: nobody's perfect. i've given bad advice, so has Dave. if you look in 2nd edition of "The C++ Programming Language" by Bjarne Stroustrup, you'll find void main... We're all fallible. ;-)
 
sbi
@JohannesSchaublitb How in the world can that be a function decl?
template<typename T> Int i
 
@AlfPSteinbach :-)
 
sbi
4:51 PM
(Hey, indenting by four spaces works here, too.)
 
@AlfPSteinbach I have also seen Bjarne use delete p_arr in one of his books when it should have been delete[] p_arr :)
 
stroustrup also claimed that function templates could have default arguments xD
for the template params!
 
@JohannesSchaublitb do you mean function templates or template functions?
 
@sbi it's some retarded trick
 
sbi
@Fred What are template functions?
 
4:53 PM
@Johannes: i think best comment about such was Andrew Koenig, about some erors in "Accelerated C++": paraphrased, right, it's technically not correct, but it will be correct... :-)
 
@JohannesSchaublitb typedef Int fun(); or something?
 
sbi
@JohannesSchaublitb I expected nothing less from you.
 
@sbi instantiations of function templates
 
@Fred has it straight
 
4:53 PM
@JohannesSchaublitb yay :)
 
sbi
Ah, so you mean it's the explicit instantiation of a function template?
 
typedef void Int(); will make it work
the term "template function" doesn't exist in c++03 anymore
 
sbi
I didn't even know that term ever existed.
 
g++ accepts this, is it wrong? template <typename T = int>
void fun(T x)
{
}

int main()
{
fun(5);
}
 
sbi
Once we're at riddles, there's also the infamous [](){} of C++1x.
 
4:56 PM
@sbi Isn't that just a lambda? We could also call it: [](){}()
 
sbi
Like in int main() {[](){}();}
 
@sbi it comes from the ARM, where it was actually defined. I believe it wasn't really defined in C++98, but nevertheless used ocasionally
so it was removed by c++03
 
sbi
@sbi That`s looks like a smiley gone wild. :)
@JohannesSchaublitb How could it be removed if it was never defined??
 
@sbi c++98 used the term but it never defined it
 
sbi
@JohannesSchaublitb Oh, I see.
 
4:58 PM
@Johannes: What about template <typename T = int> void fun(T x) { } is it wrong? g++ does not complain.
 
like c++03 still uses the term "non-template function" but never defines it
very annoying
 
@FredOverflow Why would g++ complain? It is fine.
 
@Fred yes c++0x allows that
 
@PrasoonSaurav Because Johannes said function templates cannot have default arguments. Right? Or did I misunderstand you?
 

« first day (28 days earlier)      last day (4903 days later) »