« first day (323 days earlier)      last day (4608 days later) » 

1:03 PM
When should you declare a Destructor virtual and why?
 
when there is no overwhelming reason to do otherwise
or, that's the answer to anyone posing the question
 
When it is possible that someone will delete p where the static type of p differs from the dynamic type of p.
 
@sqlmole 'For any polymorphic class' is a good rule of thumb to start with.
 
To avoid undefined behaviour
 
My answer would be so that the base class does not get deleted which may cause delete bugs?
 
1:06 PM
@sqlmole a bit unspecific. A virtual destructor doesn't prevent the base class from being deleted, and what are "delete bugs"?
but I suspect that what you meant is about right
 
well if you delete the base class and you try to create a derivative it would cause an error because there would be nothing to derive from?
 
a polymorphic class either should have a virtual destructor or a protected destructor
a protected + virtual destructor only makes sense in the rarest cases and a public non-virtual destructor is most probably a mistake
 
if you delete the base class, the destructor for the derived class won't be called unless the base class destructor is virtual
 
yes that is one possible behavior
 
It actually could
 
1:13 PM
fair enough. It's undefined behavior if you do it :p
if you make the dtor virtual, the derived class's dtor gets called and everything works out. If you don't, it's undefined behavior and anything may happen, but most likely, the compiler will generate code to call the base class ctor and nothing else
 
"Pointers to void (after pointer conversions) can be compared, with a result defined as follows: If both
pointers represent the same address or are both the null pointer value, the result is true if the operator is
<= or >= and false otherwise; otherwise the result is unspecified."
 
What is the order of initalization for data?
 
so legally int a, b; &a == &a is always true, but &a == &b could be true?
@sqlmole members when constructing?
ah wait they're not going to be void pointers there
 
@awoodland i dont know i just found the question on google, have no idea what it is asking
 
it could be asking at least two related but different questions
 
1:17 PM
Members of a class are initialised in order of declaration. Globals are initialised in order of declaration. Globals in different TUs are initialised in an unspecified order with respect to each other.
 
members what do you mean? is that member functions or variables
 
@Mankarse - that was far more succinct than where I was going....
 
@awoodland I think what you're quoting is about comparing in the 'ordering' sense, not in the == sense.
 
Member variables
Member functions are not initialised as such
 
so wouldnt member variables be initialised in the order the appear in the code?
is that what its asking
as its compliled in an order
 
1:19 PM
@awoodland To clarify -- I'm speculating only from your quote, I'm not familiar with it though.
 
@Luc - I think you're probably right, it does look like it's talking about ordering, I was just searching for void * to see if there were any interesting uses for it I wasn't aware of
 
Whats the difference between a static function and a private function?
 
anyone can answer a little question?
 
I had no idea that while char a[42]; assert( a < a + 1); was well specified, char a[42]; assert( (void*)a < (void*)(a + 1) ); was unspecified though.
 
there is nothing called private function in c++
 
1:24 PM
@MrAnubis - what exactly do you mean?
 
@sqlmole static/non-static refers to being a class or an instance property. "private" is an access restriction. The two have nothing to do with each other.
 
A private member function can only be called within the object it belongs, a static function can be called by anything in the same file
 
@awoodland : why is it said that "typename" must be present or Appears in a template
 
@sqlmole Ah, also the word "static" has something like five different meanings. You have to say which one you're talking about.
 
@KerrekSB why is it said that "typename" must be present or Appears in a template
but i find it wrong
 
1:26 PM
@sqlmole Not strictly true. Consider: class foo { void member(); void bar(foo& other) { other.member(); } };
 
@LucDanton ah, pedanticism, this channel's chief export :)
We could supply a small country
 
@LucDanton the spec seems to say that assert(a < a+1) is unspecified
 
@sqlmole Here, member is private but is not called on *this.
 
@MrAnubis - if I'm guessing right you have a typedef in a template and you're trying to use it somwhere else in a template by saying foo<T>::my_type?
 
@JohannesSchaublitb for void pointers, you mean?
 
1:28 PM
@JohannesSchaublitb wut
 
@KerrekSB can you answer a little question?
 
@jalf for both void and non-void
at least, I can't find a bullet that fits
 
@awoodland -> see this codepaste.net/u7a8ra
 
if I'm right you need to tell the compiler it's a type by saying typename foo<T>::my_type;
 
you true
 
1:29 PM
@MrAnubis - opposite problem
 
@JohannesSchaublitb Sure? There's something about pointers to a scalar object being able to be treated as arrays of size 1, and for arrays, it would be well defined
anyway, I've got to run
 
func() doesn't depend on any template parameters
so you must not say typename before the type
 
@JohannesSchaublitb Well okay but if pointers into an array couldn't be used as iterators I think we'd have heard about it some time ago.
 
err im sorry i just found it
 
I'm hardly surprised :)
 
1:31 PM
@awoodland thanks
 
@MrAnubis I would, but I don't understand the question, nor its context...
 
@LucDanton but the spec seems to say that it compares well defined even for the void case
 
@MrAnubis womble.decadent.org.uk/c++/template-faq.html#disambiguation talks about dependent names a lot. What you have isn't a dependent name though
 
" If two pointers point to elements of the same array or one beyond
the end of the array, the pointer to the object with the higher subscript compares higher.
"
in that bullet, it takes the point of view that a void* can "point to" something.
 
@JohannesSchaublitb Neat.
 
1:32 PM
even though the formal definition of "point to" does not say such things, it does assume it in that bullet, so I think the void case is well defind too
because it says earlier "If two pointers point to non-static data members of the same union object, they compare equal (after conversion to void*, if necessary). "
so it clearly assumes that a "void*" is said to "point to" some object. so you can apply the same to the array element case IMO
however it later in that section talks about poointer to void explicitly
so it's not very clear what actually the semantics are IMO
 
Time to file a defect!
 
I discovered that you can't drag a file into the Visual C++ Express IDE when it's run "elevated" (unrestricted). That's pretty silly, I think.
 
1:43 PM
hmm
 
Because the source is running with lower privileges, so it cannot communicate with high privileges apps. It would be silly if it were possible.
 
Bah. That's just a techno-babble "explanation". It is silly to not be able to drag files into it. Basta.
 
@CatPlusPlus Trolling or is there something about the Windows security model that I'm not familiar with?
 
Als
hmmm
 
this time i was very generous with "valid" on flags. any f-word, and just, "valid". he he. :-)
 
Als
1:49 PM
huh 31 flags?
@AlfPSteinbach: Someone on a roll
 
someone's flagging pretty heavily (or systematically)
i got 8 to deal with
plus 31
that's 39!
 
Als
Whoever that is, it's in this room right now
so let me check you can't flag own messages
 
@Als - it's just like Agatha Christie
 
oh my, flagging me! :-)
 
Als
so we can find the one
 
1:51 PM
so if you get flagged do you get more points?
 
Als
Tiger, Xaade, Robot, Alf ruled out
 
how do i get flagged?
 
hm, it must be @johannes, nicht war?
 
@AlfPSteinbach nope
im not!
 
Als
Are you the one @JohannesSchaublitb
With you we are never sure
Oh btw, I just marked all of those messages as Not Valid
 
1:53 PM
Hi
 
Als
So whoever that was flagging should be pissed by now
 
"You cannot counterflag your own message" so silly. why does it serve it to me then?
 
Als
@AlfPSteinbach: Interestingly, some of those flagged messages had 3 or 4 votes
 
@LucDanton AFAIK you cannot do drag-and-drop between elevated and unelevated applications.
 
Als
I am wondering there are not enough people in this room to cast votes right now
@CatPlusPlus: Goddamn cat was it you flagging?
I didn't see any flag on you!
 
1:55 PM
What?
 
Als
You must be the one then :P
 
For class CFoo { }; what default methods will the compiler generate for you>?
 
wait.... wut?
flag wars?
 
I don't even see flags.
Why would I use them.
 
Soon I'll be able to see flags, I've crossed the 9K rep border
 
Als
1:56 PM
@CatPlusPlus: You can't see but you can flag
 
@TonyTheTiger You don't really want to.
 
Als
@TonyTheTiger: No fun, having a blue dirty circle begging to be looked at
 
@sqlmole - I think they're only synthesised on request
 
Als
@TonyTheTiger: and if you do all you see is stuff, which you can't decide if it is valid flag or not
 
oh damn, that's not very encouraging, why the heck have I been whoring all this rep then?
 
Als
1:58 PM
@TonyTheTiger: Just one good thing is you can see the most voted, most popular questions, answers, comments etc
tells you whats happening
apart from that nothing really
@sqlmole: constructor, destructor, copy constructor, copy assignment operator
 
@sqlmole Implicitly declares a default constructor, copy constructor & assignment operator, move constructor & assignment operator (assuming C++11) and destructor.
 
Als
@sqlmole: But on request not unnecessarily AFAIK
 
C++ Y U FLAG
 
@Als oh I see, well I'm still gonna repwhore
but been learning some template stuff today, interesting hmmm
 
Als
Lulz, Now folks from far off places are gonna come here asking, why you flag so much.
@TonyTheTiger: Oh nice, You might want to keep an eye on this one.
@Raynos: We don;t know who flagged it, Some user jumps in here and keeps doing that randomly.
 
2:02 PM
:(
 
BTW now I will unown you all
 
@JohannesSchaublitb you mean "disown" ?
afaik "unown" is not English
 
Als
uh why disown us? did you own us?:P
 
i was reading about that, but do not get it, why is impossilbe do have something like this:
void f(double const **p)
-------------------------
double **p(...);
f(p);
 
unown: 2.990.000 , disown: 2.450.000
 
2:03 PM
i know that soulution is double const* const* p;
 
is a Pokémon species in Nintendo and Game Freak's Pokémon franchise. Created by Ken Sugimori, Unown first appeared in the video games Pokémon Gold and Silver and in subsequent sequels, later appearing in various merchandise, spinoff titles and animated and printed adaptations of the franchise. Unlike other characters in the franchise, Unown have no singular voice actors, but instead utilize several at once. Known as the Symbol Pokémon, Unown are hieroglyph-like, thin, black symbols usually found on walls. There are 28 forms of Unown, one for each letter of the alphabet, a question mark ...
 
Als
hmmm...trick statements now, not enough of trick questions eh... @JohannesSchaublitb
 
probably 50% of those "unown"s are typos for unknown on yahoo answers
 
why are you posting that wikipedia article into the channel?
 
@JohannesSchaublitb cause it's one of the top results for "unown" on Google, and I still don't know what you mean with "unown"
you speak in riddles it seems
 
2:06 PM
if you wouldn't know what I mean you wouldn't have proposed "disown"
full stop. you are trying to trick me.
 
oh, now it's me trying to trick you... "disown" was the first word that popped to mind when you said "BTW now I will unown you all", hence my suggestion... however it doesn't mean I was trying to trick you
 
@awoodland : please look at this code codepaste.net/6ufm9r
 
i don't understand that message of yours.
first you unleash "now it's me trying to trick you" and then you state "it doesn't mean I was trying to trick you"
 
@awoodland : why is that we need to prefix typename in function parameter ?
 
Als
@MrAnubis: If you post questions in SO main, your questions will have wider audience.
 
2:08 PM
does this all mean that first you didn't want to trick me but then it started to make fun and you started to try to trick me?
 
@Als : ok thanks
 
True or Flase; a derived class may have more than one base clas?
 
3 mins ago, by Tony The Tiger
you speak in riddles it seems
 
@sqlmole : true
 
Als
@sqlmole: True
 
2:09 PM
is not equal to "I'm trying to trick you"
 
why
 
Als
@sqlmole: Read up Multiple Inheritance
 
this is called multiple inheritance
 
@MrAnubis - it's not because it's in a function parameter, it's because it's part of a template and at the time the compiler first sees it it can't know what role it is going to play in the statement/expression
 
Als
@TonyTheTiger: Thanks for that comment on that answer....
forgot to say..
 
2:10 PM
@awoodland : can you please join me in separate room?
 
@Als no worries :P
 
Als
@TonyTheTiger: I still got downvoted though lulz
:P
 
@MrAnubis template<typename T> foo(T) { int value; { T::bar * value; } } what does the statement in the inner {} block do/declare?
 
@LucDanton multiplication
 
@Als I just got downvoted for something too, just donno what yet
 
2:13 PM
@MrAnubis struct nope { typedef int bar; }; foo(nope());
 
@LucDanton : then you will have to prefix it with typename
 
Well then you do know what typename is about.
 
Als
@TonyTheTiger: I think on your question
 
C++0x question
 
Als
naah c++
@TonyTheTiger: Read your comment "good suggestion, but I don't own a copy of the standard", That true?
 
2:15 PM
template<typename T> void f() { foo<T>::type * value; }. foo can be anything. What will the thing in the function do? Can you show code that makes it a declaration?
 
@Als yes of course
 
think hard. the solution is at reach
 
Als
@TonyTheTiger: You gonna buy it?
 
@LucDanton : in your case yes but in this case typename T::Z::Y -> is used to denote Z is type dependent member of T or else?
 
(you can imagine there is a int value; at global scope)
 
2:17 PM
@MrAnubis No, because only types can be used with the scope operator (::), so no need for disambiguation. Here, typename qualifies the final Y name.
 
@Als no, I don't see a need yet, I'm not good enough with the language yet to justify the money
 
Als
@TonyTheTiger: I am not saying you should do this, but one can find an copy just by looking up on google.
 
@Luc Danton so in this case : "typename a<T>:: template b<T>::template c<U> (*Z)" -> typename is specific to c<U> ? right?
 
Why can’t we overload the sizeof, :? , :: ., .* operators in c++?
 
Yes.
 
2:20 PM
@Luc Danton : thanks for the concept)
 
@Als well, standardese English I find somewhat hard, so I'm ok at the moment
 
Als
@TonyTheTiger: :)
 
@sqlmole Because then you could break the language.
 
i found myself writing identical code in two namespaces
that must be completely wrong
but i fail to see good way to do this
here's code:
 
Is it possible to templatize the S class with character type, put it in yet another namespace (e.g. detail), and then jest use typedefs in wide and narrow namespaces?
 
2:30 PM
@Vedran I'm not sure about then picking up stringFrom free functions in right namesapce? Maybe I need to experiment a bit here...
 
You could add a tag paramater to the stringFrom functions to get around that
it depends whether they are meant to be externally used
 
yes, they're meant to be used directly by client code
 
You implement them with macros :S
 
you could string and wstring with trait class depending on character type
in detail namespace, and then wrap this defaulting to wstring or string in your narrow and wide namespaces
or you could just use template typedefs :)
 
i'd love the template typedef thing but not supported by msvc 10
i like the wrapping suggestion
it will be just a single function template as wrapper so it's ok :-)
 
2:37 PM
great
 
The problem is that the code is simple enough as it is that there is a limit to how much adding complexity to reduce duplication is worthwhile.
 
oh no wait
 
what about DRY principle?
 
what about KISS principle?
it is a matter of comprimise
 
well, then we are down to the skill level and typing speed :)
 
2:40 PM
here's usage, it specializes the templated function:
i trimmed extraneous stuff from that
 
it uses exceptions
-> slow execution
 
is there any reason that the char const* stringFrom is static but the string stringFrom is not?
 
@JohannesSchaublitb tr011
 
in high speed applications sometimes i notice a slowdown
 
@Johannes - Thankyou for your worthwhile contribution (:
 
2:42 PM
@Mankarse forgot to add static, sorry, & thanks
i was just writing this
 
Why are the free functions duplicated as class functions anyway?
 
@Mankarse one of the static member functions is a much needed optimization. the other one (the forwarder/wrapper) is then needed to let call pick up the free functions at namespace scope.
 
Why not just do the optimisation at namespace scope and be done with it?
Having two functions declared in the same place with the same names and with subtly different functionality just seems confusing
 
@Mankarse because that could screw up client code using the namespace scope functionality. e.g. writing stringFrom("blah").length() would then not compile.
Oh my I used an s word.
The flagger will flag me.
 
lol
 
2:48 PM
 
OK, I just noticed that the class ones are private
 
hm, i will have to think more about this -- how to let other code add in specializations of stringFrom so automatically used by class S, and not duplicated code. dinner...
 
@DeadMG you're going to be suspended, too
 
meh
 
http://chat.stackoverflow.com/transcript/10?m=830618#830618
http://chat.stackoverflow.com/transcript/10?m=849817#849817
http://chat.stackoverflow.com/transcript/10?m=730760#730760
....
 
2:55 PM
the flagging thing is totally out of hand
@genesisφ Your point being?
 
@DeadMG you just called me fu**er
 
meh
if you are the one going through flagging every single use of the word "fuck", then I feel it to be entirely appropriate
everyone else in the C++ chat can cope with naughty words, and flagging is extremely disruptive
 
@genesisφ STOP THE FLAGGING!! That stuff is not even offensive, so go away
I just got banned for for something I said back in may
huh? I'm so confused
 
especially since I'm not even using it to refer to anyone
 
2:59 PM
@genesisφ oh c'mon man, where is your sense of humour?
 
Okay I'm stopping
 
well, it's not about humour, it's about maturity
everyone else is mature enough to survive contact with "fuck"
3
 
Let's stop this discussion here
 
Let's not
 
I'm sorry, but now stop
 
3:00 PM
1
Q: Why am I suspended from chatting for a message that's from May this year?

TonyI have just been suspended from chatting in the C++ lounge for a message that was deleted by the @Feeds bot, that is from May this year. Why now the suspension (30 mins) for a message so old already?! Reason for ban I'm confused.

 
Or all of us get suspended
 
because I'm seriously sick of you, and whoever it is that always fucking flags Martinho, and it was Als earlier
this shit is ridiculous
if you don't like "fuck" or anything else, then you can go to another chat room
2
 
It was random search
 
why do you come you come in here, I've never even seen you here and start flagging everything with the word "f***"in it? That's just unasked for
 
or at the very least, actually participate here and then be offended instead of jumping in and flagging
 
3:01 PM
no one else ever had an issue with it
 
@Tony stop
 
@genesisφ YOU STOP
 
Okay, I did wrong thing. But, rules are rules
 
you come in here an disrupt everything, there was no problem before you came
 
@Tony what's the problem? You're not banned...
 
3:02 PM
@genesisφ They are- and there's no rule against "fuck" in the chat
 
@genesisφ that you come in here and cause unneccessary havoc, for things said that are now long history... why? There's no reason
and annoy everyone here too, on top of that
 
@Dead If there aren't, what's the reason for this ban?
 
because some moron, some moron being you, flagged it
and then people in other rooms clicked "valid"
but it's not their room - it's ours, and the Meta police won't interfere
 
@genesis stop wasting everybody's time. @DeadMG watch that language -- there is very well a rule against that
 
@balpha I did already. I said I did wrong think and I'm stopping
 
3:04 PM
huh
maybe the Meta police will interfere
that's a first
 
@balpha oh, where's that rule?
 
@TonyTheTiger I have to concur with this. The regular users of this chat room have never had a problem with such language.
 
@genesisφ so you read all that legal huh? did you even understand it?
 
@genesisφ Meh. Define "abusive language". Surprise- I might have a different definition to you.
 
3:07 PM
@Tony even if I wouldn't, it' same on all sites (almosts)
@DeadMG @Tony Stop. I'm sorry for what I did, I won't do it again. I'm stopping, too
 
@genesisφ so what, I don't care, I've never had problem chatting here, so you interfering is merely that, interference and annoying
 
41
A: Are expletives allowed on SE sites?

Jeff AtwoodNo. Expletives are not acceptable behavior on meta or any other Stack Overflow site. If you can't effectively communicate what you need to say without resorting to lowest common denominator cursing, then keep it to yourself. If you use expletives, you will get a warning. If you continue to use...

 
"You lousy cork-soakers. You have violated my farging rights. Dis somanumbatching country was founded so that the liberties of common patriotic citizens like me could not be taken away by a bunch of fargin iceholes... like yourselves." :-)
2
 
3:13 PM
lol
 
So now we've got actual kids flagging everything?
Go figure.
 
@Cat no, not anymore
 
I still think flagging system is utterly pointless and broken, and should be replaced with owner moderation.
Also why the hell flagging half-year-old messages is even possible.
 
@CatPlusPlus lol
@CatPlusPlus beats me
 
3:22 PM
I'm tempted to create a clone of this chat alone.
 
for chatting with yourself?
 
I wonder if I could churn out a prototype today.
@TonyTheTiger If @DeadMG can do it, so can I!
 
kek
 
Well, I'm hoping if I made something better, you guys would come along. :P
Doesn't hurt to try, eh.
 
Sure I'd come along, but might as well setup a plain IRC channel to replace this room
 
3:26 PM
But we like the interface, don't we.
 
yea, this interface has coolness about it
 
IRC channel is a matter of /join and /cs register, that's entirely not a problem.
 
true that
 
not a fan of IRC, I don't even have an IRC client
 
I don't have one either on my windows machine, cause I didn't feel like paying for one, so I have a linux distrib for IRC
 
3:28 PM
Any "famous" C++ stack overflowers from Hamburg besides me?
 
there are free IRC clients for Windows, like mIRC and Opera has a client too
oh by the way
had some numpty on Programmers telling me that Java was the successor of C++
 
Well, it certainly came later, but apart from that...
 
@DeadMG Maybe he meant Java is the sucks-essor of C++? As in "sucks more"?
 
3:32 PM
lol
 
@DeadMG I thought Java was the successor of COBOL. Targets enterprise and sucks beyond imagination.
 
rofl
 
Does "Java Enterprise" mean that Jean-Luc Picard relies in Java to fly through space? Hence "the final frontier"?
 
To boldly go where no object has gone before.
 
...to boldy goto... :)
 
3:36 PM
Oh, hardware acceleration in Flash wonked out again.
I always wondered how is this even possible, that this thing stops rendering and no matter what outputs only green colour.
Maybe it's mold.
 
What's the big deal with hardware acceleration? Hasn't it always been possible to drop computers from any height and watch them accelerate?
 
Strap 'em onto TGV.
 
lol
 
Okay, I've created a repo and a virtualenv. That's a good start.
 
lol
0
Q: Regarding killing a particular Java.exe

user927688I have a situation here. The problem I encounter is, I have java application say xxxx.exe. Which I manually kill that application, the corresponding Java.exe is still bind to the port. So that When I re-start my application. I cannot attach to the port. When I checked the log the message is the c...

I like the title of this question
killing java... lol
 
3:56 PM
Ah, the world of wonderful documentation.
> Obtaining and Installing
> Obtaining
> Download..
 

« first day (323 days earlier)      last day (4608 days later) »