« first day (21 days earlier)      last day (4928 days later) » 

1:15 AM
@Joel i personally like to split my helper extensions into algorithm.hh, functional.hh and so on, using my own judgement for what belongs where. It's the most intuitive grouping I can think of.
 
@wilhelmtell That's the same approach I take, though some things get split out when they start getting large.
I had a whole library of for_each-like functions for dealing with ranges of pointers.
It would probably be a total of about five functions with C++0x lambdas and variadic templates... I think there were something on the order of 50 overloads in the original library
 
@JamesMcNellis but why do you split them? For readability or for compile-time performance? If it's for readability then you can still take the common approach of #including stuff in algorithm.hh. I haven't reached the point where compile-time performance is an issue, but I don't know what I would pick between intuitiveness and and said performance.
 
Because my `<Algorithm.h>` header file got unwieldy... over a few thousand lines of code. It had nothing to do with performance, I just don't like really large files. Once I found myself adding comments like

//
// for_each_ptr implementations
//

I decided it was time to split things out.
 
1:30 AM
Ok then, so you can have Algorithm.h just #include its parts, like gcc's and other's standard libraries do.
 
Yes, I could have done that.
 
 
2 hours later…
3:12 AM
Has anyone else notice that Stack Overflow advocates C++'s awesomeness? Inline links use the lambda capture and arguments syntax. []().
 
lol
 
user34537
ha
 
@JamesMcNellis Great find. Haha :-)
How would you compare and contrast Stackoverflow.com to Usenet communities like comp.lang.c++(& moderated), c.s.c++ ?
 
3:31 AM
I've only posted on c.l.c.m once when I couldn't get an answer on Stack Overflow, and I've only posted on c.s.c twice, both times to file defect reports.
I bet Alf would have some good thoughts on that topic though.
 
Victor Bazarov is still on usenet for what I know, not on stackoverflow. So there.
 
What is a "Victor Bazarov"?
 
You're kidding right?
 
@JamesMcNellis Did you get the answer on c.l.c.m? Being a moderated site I find it very slow. I mean if you post a question today you won't get any answer today. :P
 
Yes, I did.
5
Q: Explicit Type Conversion and Multiple Simple Type Specifiers

James McNellisTo value initialize an object of type T, one would do something along the lines of one of the following: T x = T(); T x((T())); My question concerns types specified by a combination of simple type specifiers, e.g., unsigned int: unsigned int x = unsigned int(); unsigned int x((unsigned int())...

 
3:34 AM
k. phew. :p
 
@wilhelmtell: No, I honestly don't know what a "Victor Bazarov" is. Am I going to feel dumb for not knowing?
 
@JamesMcNellis Victor Bazarov is one of the moderators of comp.lang.c++.
 
@JamesMcNellis long before there was the term jonskit for c#, there was victor bazarov for c++.
 
Ah
I've honestly never paid much attention to c.l.c.m.
 
also. i just misspelled jon skeet. i should pay less visits to [c++] and more to [c#]. oh well.
 
3:39 AM
Eh. All you get from C# is less generic generics and crazy nondeterministic object lifetimes.
 
lol. airplanes have crashed because of garbage collectors.
i think.
or so i like telling myself.
 
@JamesMcNellis FYI. He is at the top of "All time answerers" there.
 
Oh. I can honestly say I've never paid attention to the unmoderated comp.lang.c++. The moderated newsgroup is more than enough to keep up with.
 
ooh. judging from bazarov's activity (all-time most posts!), looks like c.l.c.m is dead. or dying. almost. i think. Last post September 12. The post before that December 11 2009.
sorry, it's c.l.c++.
 
@wilhelmtell I think after a few years or so you will find most of the Standard guys here on SO. ;-) SO rules. :P
 
3:51 AM
Perhaps.
There's nothing wrong with comp.lang.c++.moderated. The fact that it is moderated means it has a (relatively) high signal to noise ratio.
You can't really say the same about Stack Overflow,
 
Yes, rightly said.
 
I know that Sutter took a peek here, to check if he could run gotw on SO. Sadly, because of the wiki nature he decided SO won't fit his model. :(
I think he asked on meta, and then dissapeared.
 
Well, we'll have to wait and see.
 
@wilhelmtell Yes, here is that thread.
 
@wilhelmtell He hasn't started GotW back up yet at all anywhere. When I spoke with him in June, he was serious about starting the series again. There's still a chance that we might see it come to Stack Overflow.
 
3:59 AM
Even he believes : If anything, that’s Stack Overflow these days. I can’t think of a better current match for a participatory programmer hangout with threaded discussion (and more, voting and stuff of course... even if I may need to tolerate the possibility of my questions and answers getting edited, though I'll probably ignore all non-typo edits for book purposes)
 
@PrasoonSaurav The more recent thread is:
10
Q: Stack Overflow and GotW: what happened with this?

KopI was very excited about the Herb Sutter posting GotW articles on Stack Overflow. He asked a question here on meta to - basically - ask for permission, and since it has 26 upvotes and 0 downvotes there is no doubt the community wants this. I was looking forward to it but apparently nothing happ...

 
Oh I see. Thnx!
@JamesMcNellis I completely agree with what you said i.e As long as the questions are interesting, intelligent, have an objective answer (or answers), and questions that are asked together are vaguely related to each other, I don't see many people objecting to them, especially not many of the top contributors in the C++ tag.
Jeff made a valid point : (but, I support a [gotw] tag or something similar for all the questions in this series)
 
I object! What you consider objective is a subjective opinion! I'm leaving, goodnight
 
@CiscoIPPhone This is the C++ chat room. What you call the I object we call this.
 
4:20 AM
I feel people are very defensive about SO. I am personally thrilled about GotW resurrecting from the dead, and I don't care where the posts are hosted. For all I care there can be gotw.stackoverflow.com, with static pages. It's gotw, I'm thrilled about that and don't care much about the youtubish comments that will ensue. I'd probably stay silent for my humility anyhow.
SO here is just a url for me, nothing more.
 
@wilhelmtell Certainly. I'll be happy to see GotW reappear, wherever it reappears. However, at least for me, Stack Overflow is much more convenient than anywhere else... I visit Stack Overflow every day; I can't say the same about many other technical websites.
 
Meh. It's my fingers moving, not my fit. Not that I'd mind either way. :)
Well almost. I can't pay $2500 for a seminar.
@JamesMcNellis did you go to one of his seminars?
*feet
fuck it's getting late. sorry. bad fingers, bad. :-s
 
@wilhelmtell You can edit your posts.
@wilhelmtell Yes, I attended his Effective Concurrency seminar in June. I didn't pay for it, my (now former) employer did.
 
that's awesome. a privilege.
how was it?
 
@wilhelmtell It was excellent. I had read some of the Effective Concurrency articles before I went, but the seminar really helped put things together. I learned how much of a concurrency and parallelism noob I was.
 
4:33 AM
i was proud to be very near the correct solution in his active object post. :D
i was using myself a pattern similar to his, based on the idea of factoring out the shared resources. but i didn't think about performance. i did it to avoid concurrency headache.
would you pay the money for this seminar, now that you know what it was?
 
That's a tough question because it's easy to say "yes, of course!" in hindsight, especially since I don't have to spend the money now :-P
 
lol
sigh
 
I seriously considered paying to go to C++ and Beyond, which was about the same amount. If I wasn't trying to buy a house, I'd probably have gone.
 
 
2 hours later…
6:42 AM
Hello
 
Hello. :)
 
hi wilhelmt, are u there ?
 
7:24 AM
Yep.
 
hello.....
 
 
1 hour later…
jjj
8:59 AM
anyone have a problem ?... I am here for it ..maybe i could solve it or help you with an idea..
 
the problem is wayyy too much alcohol
 
jjj
9:13 AM
hahahahahha
Good one but don't do it again..
 
9:25 AM
Liver().swap(the_liver);
 
10:23 AM
Hey, I am facing a weird problem in c++
anyone can help me?
 
jjj
maybe..
@Manjoor.. what is it?
 
@jjj i have a single line statement wchar_t * s = (wchar_t *) L"Some Data";
I want to take input from user and assign it to *s.
 
jjj
#include <iostream>

#include <string>



using namespace std;



int main() {

string name;

int age;



// prompt user for his/her name

cout << "Enter your name: ";

// read name

cin >> name;



// prompt user for his/her age

cout << "Enter your age: ";

// read age

cin >> age;



// print a message

cout << "Hello " << name << " of age " << age << "." << endl;



return 0;

}
@Manjoor an Example ... that is it ... if you meant reading from the user...
 
10:40 AM
i can take input without any problem
 
jjj
so
?!
 
but could not cast it
Would you like to see full code?
 
jjj
ok .. it has been a long time .. let me dig around
it would be better if you put it as a question
 
I have already posted but could not find a solution. It seems a very simple problem but its get complicated as my programming background is not C++
 
jjj
then post the link over her
 
10:46 AM
6
Q: L prefix for strings in C++

ManjoorI have a static library. This library have the following function defined int WriteData(LPTSTR s) The sample to call the function is LPTSTR s = (LPTSTR) L"Test Data"; int n = WriteData(s); WriteData return 0 on success and -1 on failure. I am writing a dynamic DLL to export this functi...

 
jjj
ok
 
Problem is casting. I am unable to find a funtion to perform the same task as L macro is doing
 
jjj
Like this :
int a;
double b=5234.6345;
a static_cast<int>(b);
??
 
I have modified the question have a look at it. I found out the code similar to my problem. Let me post it
 
jjj
you want to cast it from what to what?
 
11:00 AM
please have a look at the full code.
 
11:13 AM
So what does writeToSql return Manjoor?
wchar_t * s = (wchar_t *) L"INSERT INTO OE(sqltext) VALUES('this text')"; Would be better as const wchar_t * s = L"INSERT INTO OE(sqltext) VALUES('this text')";
Also you're passing your wchar * into the function that accepts SQLCHAR *
Are they the same thing?
 
It is running fine. It is returning 0 as expected.
yes SQLCHAR * and wchar_t * are same.
my problem is just put user input at the place of 'this text'
 
Oh I see
I'd probably use a wstringstream to build the string. It depends.
std::wstringstream ss; ss << L"INSERT INTO"; ss << someUserInputString;
SQLExecDirect(stuff, ss.str().c_str(), ...)
 
11:47 AM
 
 
1 hour later…
12:50 PM
@Cisco: thanks I'm stealing that :-)
 
thats funny
:)
 
 
1 hour later…
2:00 PM
hi all..
 
Hi Sara
 
hi
 
still wondering what to read on c++..
which one is the best, more practical and easy to understand.. i have "Thinking in C++", "Accelerated C++", "C++ Primer", "C++ How to Program (Deitel)" "SAMS Teach yourself C++ in 21 days", "Practical C++ Programming"
 
I can't really answer, I've only read one of those
 
2:23 PM
Accelerated C++. You won't need any of the others. Give them for charity.
 
i read a few chapters from Accelerated c++, it looked kinda boring to me as the initial parts were only dealing with vectors, and structures..
 
anyone know a good article on pointers and scope?
 
what do you want to read about Sara?
 
hmm.. real world, practical solutions with OO concepts?
btw, how have you guys developed C++ skills? Books or self experience?
 
books and experience and practice
and SO
 
2:38 PM
how do you practice? anywhere to get simple programs with source code?
 
@Sara then you should start banging out code. Pick an idea and go for it. Don't be scared to implement it "wrong". If you have a question about how to do something then come and ask. If you have doubt about code or something breaks come with your code and ask.
2
@Sara what kind of programs interest you?
 
my practice for C++ is mostly at work nowadays
 
Yep programming is a skill, not just theory. Start off with simple programs and work your way up.
 
@wilhelmtell im working on a hypothetical patient handling system. i feel doubtful at some points, when deciding whether its good practice or not
@wilhelmtell so you started your c++ career with Accelerated C++?
 
2:55 PM
@Sara actually not. I started it with an old book in a foreign language. Today that book is irrelevant; it doesn't even deal with modern C++. But what I recall is that it is very important to have exercises in the book, and the exercises should be fun and interesting. Granted, that is a subjective matter. If there are solutions to (some of) the exercises then that's a good thing.
But I did skim through some of the books you mentioned (deitel in particular, as well as accelerated c++ and sams". accelerated c++ seemed to me like the most serious among them; the others seemed like large blobs of bs.
If you find Accelerated C++ dull then leave it. Boredom is a dangerous thing.
 
heh, the first book on C++ I read was "for dummies", which I was, but this was also years before the 98 standard :P
stroustrup has a recent book which I have read and recommend
 
i also saw on ACCU that accelerated c++ is mentioned as the "de facto" book for beginners
 
Ah. I'm a fan of Stroustrup. Extremely intelligent fellow, the guy knows what he's talking about. But I never read his latest book, only his TCPPPL3e. That book is a must-read but for only once you have a good amount of experience with the language. It's not for beginners, even though it does have an "introduction to c++" and "introduction to the standard library" parts.
 
@Sara: AC++ is good; it's the first popular book (to my knowledge) that avoided teaching c++ as "c with classes" and was targetted at beginners
 
@Sara yes my school used that book for its teaching. in particular my c++ prof, who i admire, recommended that book. hence my word.
on the other hand i took the c++ class a couple of semester beforehand, where the course was teached by a different fellow who decided to use deitel. when i looked at the book i became very skeptic about the class. then, on the SECOND class, someone asked what the difference between a class and a struct is; the prof answered that a class can have member functions. i got up, left and dropped the class that very instance.
 
3:07 PM
hehe interesting story :)
what are the unique features c++ having compared to java or c#
what will be the language of the future?
 
@Sara it's natural to have doubts because its your first code. just go on with things. you will likely fail at various points, but the best thing is that you'll know EXACTLY what works and what doesn't. When something doesn't work you'll know WHY, because you tried it and failed. It won't be a matter of "good practice" or "bad practice" any more. When something is not good you'll know exactly what problem it poses and when. You'll have EXPERIENCE.
and that's more important than choose one book over another.
what's more, you'll be the one leading the way in exploring things. you'll have the choice of keeping things at a fun level, in the domain of your interest.
 
@Sara: There's a fairly good C++ book list here on SO. And I second Roger's advice about Bjarne's latest, although only on hearsay and skimming table of contents. If you want more advanced book do read Andrei Alexandrescu's "Modern C++ Design". One book missing on the SO booklist, Barton and Nackman's "Scientific and Engineering C++", a bit dated but still reportedly superb.
 
if you want to do something and don't know where to start, come and lay your goals exactly. we'll help you find a proper path in getting it done.
 
I only have a few C++ books: various editions of TCPPPL and MCPPD, and the old ARM.
 
@AlfPSteinbach Alexandrescu's book is hardcore. can be overwhelming as a first book.
 
3:15 PM
even as a second book...
 
@Sara none that exists today
 
I just recently got that book
bought*
 
@Wilhelm: no, I don't think so. You need to be smart to gain something useful from it. But you don't need to know much (all explained). :-)
 
the post singularity language of the future is english: "COMPUTER MAKE ME A SANDWICH"
 
@AlfPSteinbach there's lots of generic programming there. i think one shouldn't get into generics before they are at least comfortable with the basic features of C++, and then after they've written at least a couple of algorithms a-la <algorithm>.
 
3:19 PM
computer: transforming you into a sandwich. user: no, no stop! computer: double negative detected, ignoring request. ok I'm finished, sorry.
 
you guys are doing a superb job on SO helping out newbies like us
appreciate it always
 
@Wilhelm: yes and no, as I see it. Simple use of generics belongs somewhere at the start of learning C++, and I think it's put there in "Accelerated C++". Andrei covers more advanced template metaprogramming.
@Wilhelm: consider that Andrei (as I recall) was a student when he wrote that book. :-)
 
@AlfPSteinbach "simple use of generics" is implementing std::find() or std::remove_copy_if(). Nothing like what you have in that book.
 
@Wilhelm: yes, simple use of generics belongs somewhere at the start of learning C++, and I think it's put there in "Accelerated C++". Andrei covers more advanced template metaprogramming.
 
I'm not advocating against the book. I think it's an awesome book. It's just that I hate people feeling discouraged, because C++ is hard. I say go for the hardcode only once you have the this-is-sparta excitement.
*hardcore
 
3:27 PM
@AlfPSteinbach a grad student is usually distinguished from other kinds of students
looks like the timeline puts him squarely in the middle of his doctoral dissertation when it was published in 2001 (but it's hard to tell, didn't see many dates on his site) :P
 
what is the benefit of using "iterators" instead of indices?
 
lots of little benefits
the simplest way to explain it briefly may be that indices are impossible
 
55
A: Why use iterators instead of array indices?

wilhelmtellThe first form is efficient only if vector.size() is a fast operation. This is true for vectors, but not for lists, for example. Also, what are you planning to do within the body of the loop? If you plan on accessing the elements as in T elem = some_vector[i]; then you're making the assumpt...

 
for example, a std::list (and the abstract linked-list type it represents) cannot be indexed
 
4:06 PM
Worth noting that list size can be fast. The Holy Standard intentionally allows splicing operations to be linear so that size can be obtained constant time. I think all standard lib implementations choose fast splice ops, but I'm not sure.
 
4:51 PM
@AlfPSteinbach In C++0x, size() is required to have constant time complexity for all containers that implement it. Howard Hinnant wrote a paper discussing the pros and cons of this (the original copy seems to be unavailable at the moment; the Internet Archive has a copy: web.archive.org/web/20060207085412/http://home.twcny.rr.com/…)
 
@James: I wouldn't believe it except Howard had argued things like that earlier (what do you call it, when you outfit a horse with a contraption so that it can't see anything except in straight forward direction?). It's silly: splice is about the only good reason to use a std::list, the rest doesn't count at all. Do you have a reference, like, chapter & verse?
 
In the latest draft, N3126, 23.2.1, Table 93 Container Requirements, size() is listed with a complexity of Constant.
In C++03 that table just says that size() "should" have constant complexity.
 
@AlfPSteinbach the horse things are called blinkers
 
@james: thanks. I just checked. OK, if that's typical for C++0x (what with throwing move ops (another such blindsightedness) and MS guaranteed non-support for some of the syntax and ditching of concepts proposal and so on), well, that's probably C++0x down the drain. My guess, compilers will adopt some of the nicer features, like some of the rvalue reference stuff, and that will be it.
 
We shall see.
 
5:04 PM
:-)
 
5:59 PM
stdint.h is a header file in the C standard library introduced in the C99 standard library section 7.18 to allow programmers to write more portable code by providing a set of typedefs that specify exact-width integer types
 
6:10 PM
@AlfPSteinbach: It was pretty much a foregone conclusion that MS wouldn't support C++0x.
 
but they've taken such a liking to C99...
 
@RogerPate: you're a funny guy.
 
try the veal, I'll be here all week
 
At this point I don't think MS is interested in anything besides legacy support for any non-managed languages.
 
Support for some C++0x features is better than none
 
6:16 PM
Half-baked support that doesn't actually conform to the standard would be worse, however.
 
@Stephen: it doesn't make business sense for the company to be interested in more, at least not in the short-term, so I don't expect more either
s/them/the company/ because they do have some incredibly smart people both interested in moving c++ forward and working hard on the technical side
 
@RogerPate: of course. There's no shortage of smart technical people there. It's the business side that I expect to screw things up. =/
 
yeah, I just try to be explicit because I see too many people confusing the business and technical sides, which doesn't help anyone
 
Several of the smartest people I know are at MS. Nothing they've worked on has ever made it to market though.
I would find it way too frustrating to work in that environment, personally.
 
6:31 PM
@RogerPate From a conformance standpoint, the C++0x features added in Visual C++ 2010 have been very good, so far as I've been able to tell. Progress certainly hasn't been as rapid as, say, g++'s progress in implementing C++0x features, but that's been the case for a while now.
Whether the current pace continues, well, we shall see...
 
I was referring to msft's statement they flat out won't implement certain features, which Alf mentioned
 
I want the new looping syntax :<
 
@RogerPate The only major feature I know of is attributes, and my understanding was that, at the time, it conflicted in some way with the nonstandard Visual C++ attributes. I don't really know, though; that's a piece of C++0x about which I know just about nothing.
@CiscoIPPhone Really? I've never really seen the appeal of yet another looping construct. Now that we have auto and now that lambdas can easily be used with for_each, it doesn't seem as necessary to have the range-based for loop.
 
@James: how would you write stackoverflow.com/q/4062382/54262?
 
I like the brevity of it
 
6:44 PM
@RogerPate I'd use the crazy lambda with find_if that Frederic shows in his answer. ;-)
 
@James: "Spertus asked whether it is true that Microsoft refuses to implement this feature attributes. Caves confirmed that it is. " However, possibly due to that?, the committee restricts attributes to things that don't affect a valid program. So, Visual C++ might get by simply by ignoring them, just as Visual C++ so far has ignored exception specifications.
 
seriously?
 
I don't find for(auto it = g_cpfs->htab.begin(); it != g_cpfs->htab.end(); ++it) to be too verbose
@RogerPate No
 
don't forget to add auto const &handle = *it; in the body
 
@AlfPSteinbach I have no idea. I only know what is reported in those meeting minutes--that, and "The syntax, using [[...]], conflicts with the syntax used by Microsoft for their (very different) attributes. Microsoft has said they will probably not implement these standard attributes."
@RogerPate Ok. I'd probably also negate the two if statements and turn them into guard clauses (thought that's unrelated to the for/range-for/for_each decision).
Perhaps I should rephrase what I said above: I don't mean that it wouldn't make some code cleaner. I mean that of all the C++0x features, that one is near the bottom of my list of "awesomest or most useful" features.
 
6:51 PM
it's not in my awesome list, but then neither is auto
both are in my useful list
I do believe ranged-for is artificially and unnecessarily limited
but this is more a general gripe with stl-style iterators
 
 
4 hours later…
10:45 PM
http://www.amazon.co.uk/C-Programming-Language-Special/dp/0201700735/ref=sr_1_1?ie=UTF8&qid=1289083408&sr=8-1

Who has it, who recommends it?
This book "The C++ Programming Language" not the web site
 
user379888
Hello
 
user379888
Can anyone help me with a flowchart
 
I have the first two editions. Used to have the third edition also but someone borrowed it. Many years ago. So, as you can infer, it's a popular book. If you have only one C++ book, this is the one to have (after all it's written by the creator of the language).
 
Yeah I like it
 
Dam it... and here was me thinking I could get away with not spending money...
add this to my LONG list of books I want to buy
 
11:08 PM
Let's play a game
say a title of a film or book, but replace one of the words with something to do with C++
no that sucks
Lord of The Pointers, The Time Travellers Lambda, Teenage mutant undefined behaviours, The Beauty and the Struct
 
11:22 PM
@CiscoIPPhone those games sound like fun :)
heheheheh
make up some more titles
:)
 
The bug in God's eye
 
:)
Thread Monopoly
 
Back to the inheritance III, A nullptr on Elm Street
 
lol
thats funny
you could make that: I feel like a nullptr on Elm Street
lol
 

« first day (21 days earlier)      last day (4928 days later) »