« first day (16 days earlier)      last day (4931 days later) » 
03:00 - 17:0017:00 - 00:00

3:56 AM
C++ chat is back in college radio mode, I see...
 
yeh i think people need to talk, otherwise it stays silent
:)
Hey Alex! We've been waiting for you. Good to have you.
 
hrm?
 
lol kiddin
 
Good Morning everyone. Its 9:40 AM here in India. :-)
 
4:20 AM
Good morning sire!
 
9:40?
That's literally on the other side of the world.
 
4:37 AM
So, roughly 12,000km from you, if you walk straight, taking the shortest path.
in other news, this planet has a single core and it's doing just fine.
 
@wilhelmtell Only if I enable god mode so I can walk on water!
 
lol it's a chance to de-capitalized that g :p
 
4:51 AM
Did anyone hear from Neil Butterworth lately?

P.S : Asking this because the "about the room" section says "C++, general programming, and *Neil Butterworth memorial* "
 
No
At least I haven't and no one here has said they have heard from him.
 
5:20 AM
@PrasoonSaurav search meta. there's a thread there about it. apparently he lost his patience with the spoon-feeding culture on SO. Or so is speculated.
 
Als
Hey All
 
@PrasoonSaurav that's why it's a memorial :(
 
But we know he talked about this with Jeff in a private email exchange, and decided to have his account wiped out. this happened about a couple of months ago.
 
Als
pretty quite in here..
 
yeah, but we don't know what they said (which is reasonable for a private email)
 
5:24 AM
@wilhelmtell : Yes but did you notice who asked that question at Meta ?
 
Als
Do you guys feel, SO is heading towards sopon feeding culture?
 
no more than it was last year
or the year before that
 
@PrasoonSaurav touché
 
Als
I believe most of the spoon feeding happens bcos of the rep system. People even end up doing someones Homework.
 
5:28 AM
@Als that's borderline trolling
 
@Als : There's a special "homework tag" for that purpose. :P
 
I think C# caters to the spoonfeeding culture. </trolling> (but C# trolling is acceptable in the C++ room, right? :-P) </half-joking-sort-of>
 
@PrasoonSaurav: don't use the [homework] tag
 
"the homework tag, like other so-called 'meta' tags, is now discouraged." meta.stackoverflow.com/questions/10811/…
 
5:32 AM
@RogerPate : Oh I didn't know that. Thanks for the link.
 
Als
homework tag is discuraged or asking homework Q's is discouraged too?
 
i don't know if i agree with that.
 
@RogerPate This is post number 66666, heh
 
@RogerPate : But it has been clearly mentioned there "Don't downvote a homework question that follows the guidelines and was asked in good faith." . Now how could someone possibly decide that (if the question was asked in good faith)?
 
@RogerPate I am glad to hear that. I've always hated the [homework] tag.
 
5:34 AM
it's not about tagging for the sake of organization. it's about marking a question to be answered differently.
@JamesMcNellis why? don't you think homework questions beg for different kind of answers?
 
@PrasoonSaurav A good homework question should either (a) be indistinguishable from a non-homework question, or (b) clearly state that it is a homework question and that the OP is looking for pointers, tips, hints, suggestions, or the like, but not a complete solution.
@wilhelmtell See ^^
 
k. so?
where's the problem here in tagging?
 
No, I don't think that a "homework" question deserves a different answer than a non-homework question.
 
if you say in the question 'homework' or if you write 'homework' in the tag line makes no difference for me. beauraucracy.
 
@JamesMcNellis : So is this :" stackoverflow.com/questions/4066576/… " a homework question(although we don't see the [homework] tag?
 
5:38 AM
@JamesMcNellis it seems like a good idea initially (did to me very early on), but I quickly grew to dislike it, too
 
@PrasoonSaurav I don't know if the OP there is asking about homework, and I don't see why it would matter.
 
man this neil butterworth guy was good ;( all the noobs drove him away
 
@PrasoonSaurav just as for any other special requirements, state in the question if you are not allowed a certain type of answer or are looking for a certain type of answer — usually this is easily inferred from how "homework" questions are asked, anyway
 
@RogerPate Of course, nothing was as bad as [possible-homework]...
 
@JamesMcNellis well but that's how it is. If someone asks for help writing an AVL tree there are (at least) two answers: the answer for a homework and the answer for everyone else.
 
5:41 AM
@wilhelmtell "How does being assigned by a teacher change how the OP will best understand?" stackoverflow.com/questions/4058339/…
 
it's not about understand. if understand has anything to do with it, it's the answerers' understanding.
 
@wilhelmtell I don't follow.
 
we're talking about learning and getting better at being a programmer. but every question has countless faces. sometimes you think you understand the question when in fact you don't. sometimes the question is the wrong question.
 
@Reno He was not "just good", he was one of the best. :)
 
this is all about directing the answers in the direction the op wants.
 
5:44 AM
@wilhelmtell: how does tagging [homework] help you to better answer the question for the OP's needs?
 
and if a tag helps, so be it.
 
@wilhelmtell: If I ask a question about my PhD thesis, should I tag it [homework]?
2
 
@RogerPate Good one :)
 
@RogerPate back to my example. if you ask me how to write an avl tree then my answer is don't write an avl tree. but if a student asks me that same question i will tell them exactly what they need to do.
 
@wilhelmtell: that's the XY problem, where the requirements are insufficiently stated; it is orthogonal to "homework" questions
 
5:46 AM
@RogerPate if you feel so inclined. it has nothing to do with the word "homework". it has to do with directing the answer. it's a communciation thing. people do that.
 
@wilhelmtell I've never implemented an AVL tree, but I'd consider doing it because I like implementing data structures. Should I tag a question about implementing an AVL tree with [homework] even though it's not homework?
 
@wilhelmtell: people communicate better with words, not tags
@wilhelmtell: "meta" tagging seems to help, sometimes, but it really doesn't; that's why [subjective], [beginner], and several others have been removed
[homework] and [basics] are next on my list
 
@JamesMcNellis that's perfect. so say it in your question. writing "homework" in the tag is a shortcut. it might be a homework, it might be for fun. doesn't matter. one word saves you all those futile answers of "why the fuck are you writing a text editor" or "wtf avl"
 
those aren't answers, they're comments
and if you haven't sufficiently stated your requirements and someone asks about that in a comment, you should reply in a comment or update the question
 
i'm just talking about language here. you can do the same with words, that's right.
 
5:49 AM
this is exactly the XY problem
tagging [homework] says nothing about what you're doing; all it does is indicate that the problem was assigned by a teacher — but SO questions are supposed to stand the test of time, being useful to many other people
 
@RogerPate Ah; I hadn't heard the term "XY problem" before; it's good that that problem has a name.
 
jjj
ahm
 
tinyurl.com/meta-xy links directly to it on SO.meta :)
 
For example stackoverflow.com/questions/4066873/… is a badly formulated homework question.
 
I'd like to better express the answer on meta, but not sure how to do that
@PrasoonSaurav: it's badly formulated irrespective of being homework
 
5:51 AM
@PrasoonSaurav A badly formulated homework question is no different than a badly formulated non-homework question...
They're both badly formulated.
 
@PrasoonSaurav: see my comment on it
 
@RogerPate If you remove "proper" from that rhyme, it fits the meter better...
 
@JamesMcNellis Yes correct.
 
the point is that you're still going to have questions that beg not to have a complete walk-through answer. and you need to say it somehow, as an OP. So you add a sentence to the question. Good. Now what did we do? Who are we fooling by removing a convenient notion, the homework tag? People still say the same thing, only with more words now.
 
does it? I have a US-midwest accent and don't notice that
 
5:54 AM
@JamesMcNellis Haha! :)
 
how about "Don't be vague, be an ace; write a proper test-case!"
 
don't be vague/be an ace/learn to write/a test case
Yeah, that works better
 
@RogerPate Its much better
 
there are no stupid questions they said :|
 
@Reno There are no stupid questions, just a whole lot of inquisitive idiots.
 
5:57 AM
And what kind of question is stackoverflow.com/questions/4062517/… ? Is it a stupid question or not? :-P
 
yet another ++i++ <<= (++i+=i++) question
 
did you know that sept 28 is as a stupid question day :D
 
@RogerPate Maybe these people are from eBay... "EXCELLENT QUESTION!!! WOULD ANSWER AGAIN i = i+++++++++++++++++++"
 
hah
must.. resist.. urge.. to.. comment.. that..
 
@JamesMcNellis I am from India and I see so many questions of that type been asked at local communities on orkut and facebook . Duh :(
 
6:01 AM
I'm not sure why i = i++ type questions are interesting, but there is something about a basic type with basic operators that you think you understand
 
Im from india too , its sad that they ask these at interviews
 
I certainly spent at least a day trying to figure it out — before I learned about sequence points
 
I think I spent a week trying to comprehend sequence points.
 
@JamesMcNellis Me too. :) And I think I am still not a master at "sequence points"
 
writing a C compiler is perhaps the best way to understand the concept
 
6:04 AM
I wonder if mastering sequence points must be sequenced before mastering the new "sequenced before" language in C++0x...
2
 
(usually C90 is used, which can be done mostly without complication)
tell me about it, I still haven't looked at that part of the draft
 
@JamesMcNellis Yes that should be. :-P
 
@RogerPate That was my goal earlier this year until I got bogged down trying to write a conforming preprocessor for all four language standards...
 
user image
2
 
I'm in a much better position now to understand that than I was when I learned sequence points, though :)
 
6:05 AM
sequence points amidoingitrite ?
 
@Reno: on some conceptual level, they're not much different from punctuation
 
@Reno What?
 
im kidding
 
you have to express your code in the "grammar" (not as in BNF) that the compiler/language-standard understands
 
6:08 AM
@RogerPate Johannes' answer here: stackoverflow.com/questions/3690141/… might be useful. Also have a look at this thread : stackoverflow.com/questions/3852768/…
 
has 0x cleaned up op++(int) any, so that it's more like types such as int?
Ideally, I'd like obj = *x++ to do the equivalent of obj = *x; ++x;
though I doubt this is the direction c++ is heading :(
 
To the best of my knowledge (which is...limited), I don't think anything related to op++() and op++(int) has changed.
 
6:36 AM
Of all the ugly things in C++, operator ++(int) might bug me most of all
 
why is everyone answering with ansi escape codes for writing a plain text file? stackoverflow.com/q/4067017/54262
 
There should be a tag that means "by the time you understand what you are asking you won't even care what the answer is"
like the recent question about how to time out on user input from scanf
 
meta-tags are explicitly discouraged :P
 
@RogerPate \x49\x20\x64\x6f\x6e\x27\x74\x20\x6b\x6e\x6f\x77
("I don't know" for the mortals in the C++ lounge :-P)
 
huh, why did "use curses" get voted down while #define ANSI escape codes got voted up?
 
6:43 AM
python -c $'print repr("\x49\x20\x64\x6f\x6e\x27\x74\x20\x6b\x6e\x6f\x77")'
 
Cheater!
 
I cheated even worse, didn't need $'' :P
(I was using echo $'...', then I thought I should really print the repr in case there was something embedded)
 
I think there's a rule against posting a rootkit encoded in hex escape sequences in the C++ Lounge...
 
not yet, and we don't need one: if you run untrusted code in a leaky sandbox, you get what you deserve!
 
 
2 hours later…
sbi
8:32 AM
@PrasoonSaurav I don't know anything about Neil, except what was made public. As I've written in comments to answers to that question on meta (meta.stackoverflow.com/questions/68647/…) I don't even particularly care about Neil. (ISTR once flagging him because his attitude was worse than impolite.)
Yes, his departure triggered what got me thinking, but only indirectly: I am worried because I have heard what was said to be his resentments by other highly reputed, long-time users.
According to others, Neil has been known to go into hiding before (from c.l.c++.m, for example), and Johannes just posted a comment saying that he also disappeared from Usenet.
By now I really regret I have ever brought up his name in that posting.
 
@sbi So now its time to forget Mr. Neil Butterworth.
 
I've taken a long-time break from SO before, and indeed most of my hobbies; it's healthy
 
sbi
@wilhelmtell As someone who has taught C++ for years, I most certainly disagree with abandoning the homework tag.
 
@sbi : What's your display pic all about?
 
@sbi: I've been around this bush with you before, iirc :)
 
8:38 AM
@RogerPate : Yes its healthy indeed. :-)
 
sbi
@PrasoonSaurav I dunno. Maybe he'll come back, maybe he won't. I don't know Neil personally, so I' unable to care about him personally. I do care about his expertise being gone, though.
 
I think SO burnout is an inevitable part of the design
 
sbi
@prasson Maybe that I'm the grumpy old man around here?
I haven't put much thought into it. But when I started chatting, I started to dislike those made-up wannabe-mandalas, because I can't tell one from the others.
So I decided to change mine to something recognizable.
 
mandalas?
 
@sbi Hehe! BTW why do people often spell my name wrong? :-P
 
8:41 AM
oh, the default gravatar?
 
I need to make one.
 
sbi
@PrasoonSaurav I'm very sorry for doing so. It's certainly no name well-known in the western world. I had never heard or seen it before.
@Roger Yes, those.
Anyway, that gorilla is just the first thing that crossed my path and fit the mood at that moment. That's why.
 
@sbi : It is an Indian(Hindu) name. Prasoon (प्रसून) means Flower in Hindi ;-)
 
sbi
@Roger: Ah, it was you then who got that homework tag banned? I disagree violently. And IMO for very good reasons.
 
I'd be wary of a violently disagreeing gorilla Roger
 
Als
hey guys
 
@sbi: no, I didn't do anything other than what I've been doing for the past 1+ year. the meta-tagging policy came about because of [subjective], but it applies to [homework]
 
@sbi : Whats your real name BTW? :-)
 
sbi
@CiscoIPPhone Unrecoverable parse error, bailing out.
@PrasoonSaurav I've been around the Usenet under my real name for more than a decade. For very good reasons I have decided to stop that. It will stay that way. Sorry.
@Prasoon Nice name, BTW. I wish our names would still be so close to some understandable meaning.
 
oh, stop? I've recently (last 1-2 years) started using my real name much more, mostly because of what I've seen through SO
 
Als
8:51 AM
@sbi: Indian names mostly mean something actually....just they mean something in Sanskrit or hindi ;)
 
if you want to find me, you can find out where to look
 
@sbi : Thanks :-). BTW you didn't mention your real name.

@Als : Yes you are correct.
 
sbi
@prasson And I did explain why. Anyway, got work to do now. Will be afk a lot. Stay in here, though, so feel free to mention me if you want me to pick up something later.
 
I think not mentioning his real name was the point :)
 
Hmm okies. :)
@sbi @RogerPate : It seems I am just a kid in front of you guys. :-) [More than a decade? 1-2 yrs?] Cool :)
 
Als
9:02 AM
@Roger gr8 answer that one Roger :)
 
@Als: I almost hate the attention it's attracted: it just parrots information found elsewhere and I think it isn't a good representation of my answers
@PrasoonSaurav: I'm only 27 :P though I guess my online life (e.g. IRC — including publicly helping with programming, website design (that I don't do anymore), etc.) started at about ~10
@user492485: welcome, note you have to get a certain amount of rep to chat here
I think it's 10 or 20? or something low
 
 
1 hour later…
10:06 AM
I'm 27 too. Or 28, I can't remember these days.
 
@RogerPate : My online life started when I was ~18-19 years old. Thats why I said you guys are vastly experienced as compared to me. :-)
 
10:42 AM
ah, and you're only 21 now :P
when I'm on some irc channels and realize I've been there nearly two decades...
 
is template operator overloads allowed to be defined in a header file after a class definition?
 
yes
templates almost always should be defined in headers
 
@RogerPate Ok thxc
 
20,008 reputation! (as shown by stackoverflow.com/reputuation, so I need a recalc to see it)
 
Congrats.
That page is not found by me
 
10:46 AM
you have to be logged in
96
Q: How do I audit my reputation?

Jeff AtwoodIf I am concerned that my reputation score is incorrect, how can I audit it, or get a report of a detailed breakdown of my reputation? Return to FAQ index

 
I know why, you spelt it reputuation
 
haha
 
  template <typename T1, typename T2>
    bool operator==(const clone_ptr<T1>& pFirst, const copy_ptr<T2>& pSecond)
    {
        return pFirst.get() == pSecond.get();
    };
why is my compiler saying it is missing a , before the <?
on line 2
 
is clone_ptr defined?
 
I don't see anything syntactically wrong here...
yes just above this defintion
 
10:50 AM
just define that in the clone_ptr definition, as a friend
 
inside the class you mean?
 
yes, in the class definition
 
I just need to check some basic concepts... just to make sure I am not doing some silly mistake here.
if I want an array of of chars, I say char* myArray;
 
that's a char pointer
 
and then to make it 12 chars long, myArray = new char*[12];
 
10:53 AM
don't you want new char [12]
 
new char*[12] allocates an array of twelve pointers
if you want strings, use std::string
 
@RogerPate, so I put it inside the class def, and its still complaining...
 
I see...
 
no I don't want strings, I am using this char array to packdata into it
 
10:54 AM
@Tony: it's impossible to debug the above snippet
 
myArray = new char[12]; yes, so that its now 12 cahrs, of 12 bytes
 
if you want contiguous memory an easier alternative is std::vector<char>
 
@thecoshman: you could still use a string, though at that point a vector<char> often makes more sense
 
ooo snap
 
so I could go... float* temp = (vlost*) myArray;
and then *temp = 12f; temp++; *temp = 20;
 
10:55 AM
you can reinterpret_cast a char pointer if you must: reinterpret_cast<float*>(&my_vector[0])
 
so now myArray contains two floats...
 
@thecoshman: what are you really trying to do?
 
why allocate as chars if you're manipulating as floats?
 
@RogerPate Trying to pack data into an array in a format that I do not know untill run time
@CiscoIPPhone because I also want to be packing in other data types as well
 
10:58 AM
@thecoshman: then you want to cast a float* to char* in order to write, and copy the chars into a float* cast as a char* to read; rather than casting the char* to float* and dereferencing
 
so I write my data as chars by casting a float to a char...
 
has boost got such a thing as a copy_ptr<T>?
 
@thecoshman: codepad.org/Cvk2dUaA
@Tony: boost's smart pointers have some sort of cloning policy, iirc, if that's what you mean; otherwise what does copy_ptr do?
 
@RogerPate that seems very long winded
 
you could/should wrap it in a bytebuffer class or set of functions; I'll probably write that later today
would probably end up looking like python's struct module
I did write byte-oriented iostream classes a long time ago, for "binary" IO, but that code is lost
 
11:05 AM
codepad.org/WfAe2Uhi thats the function I have
it lets me push three floats into my data array
 
PushXYZ doesn't respect alignment
 
what do you mean?
 
though how you allocate it in this case, that is taken care of for you
 
this is probably why this is not working for me
 
unless your example use code doesn't match actual use :)
 
11:08 AM
bar the names being change, that's preetyu much all I am doing. I have a similar function that will push a set of three ints bit bashed to make one unsigned long. And I call one then the other over and over
 
void* PushXYZ(void* destination, float xValue, float yValue, float zValue) {
#define G(v) \
memcpy(destination, &v, sizeof v); \
destination += sizeof v;
  G(xValue)
  G(yValue)
  G(zValue)
#undef G
  return destination;
}
 
I see...
what is the advantage of using memcpy there?
 
it respects alignment
 
erm... but what does /that/ mean?
 
d'oh
 
11:12 AM
should I go read up for a spot on this one?
 
void* PushXYZ(void* destination, float xValue, float yValue, float zValue) {
  char* dest = static_cast<char*>(destination);
#define G(v) \
memcpy(dest, &v, sizeof v); \
dest += sizeof v;
  G(xValue)
  G(yValue)
  G(zValue)
#undef G
  return dest;
}
needs to be that, so you can increment the char pointer
should be something on SO about explaining alignment better than I can here
in a nutshell, you can only use properly aligned memory for types, where the alignment requirements vary per type
using unaligned memory causes anything from incorrect behavior, a crash, or big performance penalty
alignment ties in with low-level details of the CPU, e.g. SSE is different from general instructions and graphics card code is different still
 
@RogerPate This would work, would it not, if destination was a char* rather then a void*
 
sure, "raw memory" pointers are generally handled as either void* or char*
 
thanks... just let me get this changed so that I am using this method, and I can tell you where it is still not working :P (lack of faith in me not you)
 
I might be confused but he doesn't want data to be aligned, it's ultimately going to a graphics card (I think)
 
11:22 AM
@CiscoIPPhone your right there
oh see what the old memory alignment is now... Me thinks this might be a case where I do NOT want it alligned
Though I do use memcpy to transfer over the graphics card...
 
11:39 AM
ooh, does c++.NET still use and stick to ANSI C++ i.e. when the C++ spec says that a struct and a class are the same, will that be true for C++.NET I thought that .NET languages where the same but with just an extra library of code, for .NET features
 
If you mean C++/CLI, it's not a strict superset of C++: en.wikipedia.org/wiki/C%2B%2B/CLI
but a struct and a class remain the same
 
yer... because my ongoing battle to get my friends to see that a class and a struct are the same, one of them today said that in c++.net a struct is allocated differently to a class, making a struct faster to access data from, thus better for POD
 
well.
If there's a difference maybe they were comparing ref class to ref struct.
ref is a keyword in C++/CLI.
I'd expect plain struct/class to perform exactly the same
 
the irritating thing is, they insist that becuase a class can do more... not that it can, it must incur extra over head. I reply with, but why would a compile do something worse for a class then a struct when they are the same. to which I get, your just assuming that they should be done the same... well yer... you have to dam retarded to not do so.
The fact that even MSDN, their god send, says that struct and class are the same dose not count in their eyes.
 
@thecoshman there is no c++.net; ask them to clarify
@thecoshman there is nothing a class can do that a struct cannot
 
11:54 AM
I know, "but a class has to have extra overhead" "Do I know how a class and a struct are compiled"... no, but I know they should be compiled the same, as in 'the same'
 
"but a class has to have extra overhead" ... "why?"
much confusion can be solved by just asking "why?"
 
"*because it's a class!*" :D
ooo
 
@CiscoIPPhone exactly
 
@CiscoIPPhone: "why?" just pretend you're a two year old
 
for some reason, jsut by the fact that a class "can do more" (working on this one as well) it has to have more over head
 
12:05 PM
@thecoshman "what else can it do?"
 
@RogerPate I have nearly got them to believe that a struct can actually do all the stuff a class can. But then it started to move towards the compile working diferantly for a struct, becuase it can assume features aren't being used, so dosen't have to check for them, where as a class it assumes they are being used... flawed logic I know.
 
"what features can it assume aren't being used?"
 
but for some reason, I can't apply the logic that a class being the same as a struct is a dam good reason why they get compiled the same, but he can apply that logic the other way around
@RogerPate I have no idea with that one
 
12:30 PM
0
A: Doxygen does not show Namespaces tab in document although show is YES

Roger PateYou either need to give the namespaces some documentation or set EXTRACT_ALL to YES. Example: $ mkdir test-dir $ cd test-dir $ echo 'namespace test {}' > test.hpp $ doxygen -g # generate default config file (output) $ grep -P '^(EXTRACT_ALL|SHOW_NAMESPACES)' Doxyfile # show default setting...

@thecoshman exactly, they can't answer that question either
 
12:43 PM
@RogerPate Doesn't seem to register with them though that this sort of furthers my point
 
sbi
@thecoshman Didn't we have this discussion just the other day? I remember having said, in essence, that, if "they" insist that classes are special, then "they" need to provide arguments for that.
 
@GMan, @sbi, @JamesMcNellis: the issues at stackoverflow.com/questions/1211399/… about self-answering are relevant to that earlier discussion
sbi: I think you were in that discussion, but can't recall
@thecoshman if they claim "the compiler can assume certain features aren't being used" without being able to give any answer as to what features, you can't continue the discussion — and you won't be able to convince them
@thecoshman: if they do give you features, you have to show them that they're wrong; most likely by writing structs that use those features
 
Its really frustrating that I can't show them they are wrong. And today when they pulled out some sort of C++ in .NET allocates structs on the heap or something apparently that settled it even further for them... even though its not really the same language.
 
just say "there is no c++.net"
 
give me their e-mail addresses, I'll send them some hate mail
 
12:55 PM
The worst though was when he said that I can't just assume a compiler works the same for a struct as it does a class, and my point of, why wouldn't it just fell on ignorant ears
 
respond to "you can't just assume a compiler works the same for a struct as it does a class" with "how does it work differently?"
 
@sbi Yes we did. But as "I believe they are the same, I must prove they are the same" apparently, the spec saying they are the same does not make it so... some how
 
Could this have to do with how C# treats structs and classes as value and reference types, respectively?
 
sbi
@thecoshman You can't prove this, if they don't "believe" in the spec. If what they say diverges from the specs, they would have to provide proof for it.
 
1:28 PM
@spoulson that may be contributing to his friend's confusion, but you just have to point out that C# isn't C++
 
That may be an assumption, but it could be correct.
 
what could be correct?
 
I couldn't say one way or the other because I've only ever used native C++.
Managed C++ might treat structs differently than classes in terms of memory allocation.
 
"managed c++" isn't c++, end of story, just like c# isn't c++
 
If it's like C#, then structs are deemed value types. When you pass them as parameters, they are by value.
Precisely.
 
1:36 PM
apprat from the name of the array how is `indexData = new short[
		0, 1, 2,    // fuselage
        2, 1, 3,
        3, 1, 0,
        0, 2, 3,
        4, 5, 6,    // wings
        7, 8, 9];`
different from `
    short index[]={
		0, 1, 2,    // fuselage
        2, 1, 3,
        3, 1, 0,
        0, 2, 3,
        4, 5, 6,    // wings
		7, 8, 9};`
where in my class I have already declared short *indexData;
 
?
 
new short[1, 2, 3, 4, ...] doesn't do what you think it does
 
does it make an array with 9 elements
 
short index[] = {}; is a new array, different from your data member
@CiscoIPPhone yes
 
wait, I see
 
1:38 PM
@thecoshman: use a std::vector
 
A Norwegian might ponder the meaning of "x = 3,14;" :-)
 
sbi
@Alf Why? (Nice to have you here, BTW.)
 
@sbi: Thx. Just the comma operator. In thecoshman's example. In Norway we write "3,14", not "3.14". :-)
 
1:58 PM
@sbi: the meta-tagging policy conflicts with [c++-faq]
though I think [c++-faq] is a different type of tag than [subjective]/[beginner]/etc. that prompted that policy, that could be a very good reason to use some other mechanism than tags
 
2:11 PM
Is there any difference between auto_ptr and unique_ptr except that transfer of ownership can also be done implicitly in case of auto_ptr ?
 
can't you move unique_ptrs too?
my understanding is rather than changing auto_ptr and breaking some backwards compatibility, they introduced a new class
 
But not implicitly, that means std::unique_ptr<double> a(new double()), b ; b= a; is ill formed.
 
ah, well, that's a problem with auto_ptr
b = unique_ptr<double>(new double()); does move, right? so does returning by value?
and passing by value from an rvalue
 
I just looked into the C++0x draft. I was going to say that I think unique_ptr can be put in a container, but I'm not sure about that. On the other hand unique_ptr has more rich functionality: custom deleters and support for arrays. But I haven't used the beast. Howard Hinnant implemented an emulation for C++98 but it didn't work. :-(
 
I thought containers still required Copyable
 
2:28 PM
Could someone familiar with Linux take a look at stackoverflow.com/questions/4068333/undefined-references/… ? I'm sort of stumped by the errors the OP gets.
 
2:40 PM
@RogerPate No; the type has to be either move constructible or copy constructible. You can't use some of the container functionality if the type isn't copy constructible (for the most part, any function that takes an object by value or lvalue reference and needs to insert it into the container can't be used, for obvious reasons)
@AlfPSteinbach Since unique_ptr is move constructible, it can be used in containers.
@RogerPate Yes, because both unique_ptr<double>(new double()) and f() where f returns by value are rvalue expressions.
 
Do you know if this code will be valid C++0x:
template<int (*TFunction)()>
class Foo;

int main() {
	Foo<[]{ return 5; }> f;
}
 
@Tomaka17 No. A lambda is not valid in a constant expression.
 
Too bad, it would be funny in an obfuscated code contest
 
c++ already has enough features added for the purposes of contests
 
@Tomaka17 I don't think the standards committee accepts "would be useful in writing obfuscated code" as valid rationale for adding a feature :-)
3
@RogerPate I, for one, am looking forward to the "what is an int?" question proposed by Neil.
 
2:53 PM
then go ahead and ask it while I still have close votes remaining
 
I want to watch Lambdas, Lambdas Everywhere but I don't have Silverlight
 
I voted to close "how do I move the turtle in LOGO" too, it went too extreme trying to show the point — even though the point is valid
I wonder how accessible showing raw commands is for some :(
ideally, it'd be preferred
(out of order chat messages again)
 
3:09 PM
@CiscoIPPhone Download Silverlight?
 
Yo all, does anyone know a barebone example of an async non blocking sockets?
 
"Lambdas, Lambdas Everywhere" is boring if you already know lambdas well
 
Yeah I do. I'll skip it for now.
 
I was expecting surprising ways to use lambdas, but he only talks about common usage
 
for most programmers, common usage probably is surprising
@CiscoIPPhone meh, didn't even realize it required silverlight
 
3:49 PM
@Tomaka17 The one thing I got out of the presentation was using lambdas to more easily chunk work for non-blocking execution on the UI thread.
The presentation is definitely at an "introductory" level, but most people don't really know what lambdas are, why they'd want to use them, or that they are available in the latest versions of compilers.
 
yeah; deferreds or whatever your framework wants to call them
 
Anders Hejlsberg's PDC presentation on new async features in C# was also interesting.
It'd be interesting to see proposals to add features like them to C++, though I'm not sure how welcome they'd be in C++; there's a bit too much compiler magic required.
 
I'm wondering how many use garbage collection with standard C++, versus how many don't. I don't. Where/how should I post question about that?
 
prog.se, but I think I saw something about that there
 
thanks, but couldn't find. ok, i'll post.
 
3:58 PM
@JamesMcNellis What do you mean by async features? C++0x has an std::async function
 
4:18 PM
@AlfPSteinbach Why do you care about who does or doesn't use it? You should just listen to James Kanze and realize that everybody should. :-) Seriously, I don't mean to pick on James (I think he's a good guy) but he does get a bit stuck on this point. I don't see too much value in knowing who else uses it, and unless you know enough about what they're doing to evaluate how similar their situation is to yours.
 
@Jerry: how did you guess? He he... :-)
 
@AlfPSteinbach: See edit.
 
My question (here)[programmers.stackexchange.com/questions/16058/…. It could probably stand some improvement!
 
That's a new one. An answer IN the question.
 
@Alf: it's also linked in the feed ticker at the top of the window
 
4:51 PM
does visual studio let you use proper ANSI C++ or does it only support compiling with C++/CLI?
 
@thecoshman: Visual Studio is just the IDE. Tell it what kind of project you want, and it creates that kind of project. The compiler, Visual C++, is pretty standard-conforming as of version 10.0, but there are still some missing features wrt. C++98.
 
I see...
 
03:00 - 17:0017:00 - 00:00

« first day (16 days earlier)      last day (4931 days later) »