« first day (170 days earlier)      last day (4796 days later) » 
03:00 - 21:0021:00 - 00:00

9:01 PM
<3
 
sbi
@GMan You keep spreading love. What's your problem? Too nice a day for you?
 
<33
 
sbi
@Xeo: Did you see, @GMan hints at taking Doppelherz. Do he's not a student at all. He probably wears a white beard to his knees.
 
Xeo
@sbi Hehe.
 
:3
 
sbi
9:06 PM
Anyway, I do need to go to bed.
 
I need to get back to coding.
 
@Gman: What is: --> again?
 
lol, the "goes to operator" ;)
 
9:38 PM
Finally an interesting question :-)
1
Q: Does the position of the * or & matters?

andrewIn C++, i see pointers put in different ways. for example, char* ptr char * ptr char *ptr Are the 3 examples above identical? (same goes with the &)

 
Xeo
@FredOverflow Only that we had that already like said in that one comment. :)
But that now gave me my chance to get rep cap today, so i don't really care :D
 
It has to be one of the TOP10 questions on stackoverflow.
Right alongside "Are arrays and pointers the same?" and "Are references and pointers the same?".
And of course, the infamous "What does the const at the end of a member function mean?".
 
Xeo
Right alongside questions that aren't really questions but just code dumps. :) I always love the first comment "Yes, and what is the question?"
 
@FredOverflow I've asked that question too, back in my very beginning days
 
Oh and "What is the result of i++ + ++i?" :-)
 
Xeo
9:42 PM
@FredOverflow that's going to be asked even more often when C++0x really is out
 
@FredOverflow UB
 
Xeo
// in class
int MyFunc() &;
int MyFunc() const&;
int MyFunc() &&;
 
I don't think we will be seeing rvalue references "on the surface" much.
@Tony Yes, I know :) That's why I put it in quotes. Not my question.
@Xeo Can you really say & at the end of a member function? I thought that was implicit.
 
Xeo
@FredOverflow I think yes, to only allow that version for lvalues (eg. exclude rvalues)
 
sbi
@FredOverflow Don't forget the (in)famous "What's the result of ++i + i++?
Anyway, I really need to go to bed now.
 
Xeo
9:45 PM
...
I won't even comment on that anymore.
 
@Xeo Ah, that makes sense!
 
Xeo
wow, now that I think about this.. doesn't this leave like 5 or 6 possible overloads for the same number of arguments?
 
@sbi And "What is the result of ++i++?", although I believe that particular one does not compile :)
 
sbi
:554725 Of course I saw this the moment I had posted mine. But since I hate deleted messages (hint, hint!), I left it as a monument of my stupidity...
 
@Xeo What do you mean?
 
Xeo
9:47 PM
@FredOverflow error C2105: '++' needs l-value
:)
 
@Xeo Yeah. Although it would probably work for a UDT if operator++() is implemented as a member function.
 
@Xeo Call me ignorant, but why do you need all those overloads?
 
@GMan To prove a point? :)
 
lol
 
Xeo
The versions with && at the end are only picked when invoked on rvalue references, the ones with & only on lvalue references
 
sbi
9:50 PM
@Xeo You know, I had fun out there on the Internet, remembering the time when these two were all the rage: youtube.com/watch?v=Va83waG42NM
Anyway, I really... um, what was it?
I think I'd better go to bed now. G'night!
 
Xeo
o/
 
@Xeo I know what they do, but why do you need to differentiate?
@sbi See ya.
 
Why do I have to write database backed up by a queue.
 
i like this video because it's so artistic, it's shows a completely 100% disinterested sex symbol which is like a contradiction, they're all half-smiling ironically
 
Xeo
Maybe to have special behaviour and optimization ? Who knows
 
9:51 PM
fprintf(stdout,"%d:%d", ++i, i+1); // i only incremented once
 
It's still undefined.
 
@PiotrLegnica Yes. But why?
 
@Martin Because those expressions can be evaluated in any order.
 
@Martin The order of evaluation of arguments is unspecified. Having multiple accesses to one variable, at least one of them a write, without an intervening sequence point, is undefined behavior.
 
Xeo
@Martin Closed as exact duplicate. :)
2
 
9:54 PM
LOL
 
Didn't 0x get rid of sequence points?
 
Got rid of the wording, same results though, AFAIK.
 
Or is just the term?
 
@GMan No, (++i)++ is well-defined in C++0x but undefined in C++98 :)
1
Q: Is (++i)++ undefined behavior?

FredOverflowIs (++i)++ undefined behavior? Is it possible that the side effect of prefix increment happens after retrieving the incremented object for postfix increment to operate on? That would seem strange to me. My gut feeling says this is undefined in C++03 and well-defined in C++0x. Am I right?

 
@FredOverflow Hm, sounds familiar now that you mention it. I think there was a question on the nuance between the two.
 
9:57 PM
@GMan Yup, just found it. Guess who asked it ;)
 
Oh, beat me. :) I tend to skip over those, it's too pedantic even for my taste. ;)
 
Why O why o why did they change that. Now we will just have people writting obsecure hard to read code. Its not as if they can't write obsecure code already.
Now it will just be more obscure.
 
Is anybody forced at gunpoint to write indecipherable code, just because it is possible?
 
All the students in the world seem to be.
And the C standard library writters.
 
@Martin Maybe the majority of teachers suck at teaching?
 
10:00 PM
*dst++ = *src++
Springs to mind
Note: inside tight loop.
 
@Martin That has always been well-defined. Unless dst and src are aliases, of course. Then it's UB :)
 
Xeo
@Martin I'd always split that into two lines, just to evade that copy...
 
Yes but its obscure and hard to read. And now we will get more of it.
 
Xeo
@Martin Actually I think that's pretty straight forward
 
42
Q: Why do we have postfix increment?

FredOverflowDisclaimer: I know perfectly well the semantics of prefix and postfix increment. So please don't explain to me how they work. Reading questions on stack overflow, I cannot help but notice that programmers get confused by the postfix increment operator over and over and over again. From this the ...

 
10:04 PM
Yes and now we will get:
*dst++ = *(++src)++;
 
And what purpose would that serve.
 
@Xeo Once you knwo what it means fine. I bet the first time you read it though it took you 5 minutes to work out what was happening!
@PiotrLegnica Copy every second character to a new string.
 
Xeo
@Martin Whoever writes such code needs to be shot in the foot.
 
@Xeo Shooting yourself in the foot is one of C++'s many supported programming paradigms.
4
 
@Xeo I agree. But we should also not give them the opertunity. It is half the fault of the standards body for giving them the bullets and half their fault for shotting us in the leg.
 
Xeo
10:07 PM
@Martin >If we removed everything from the language that had the potential to confuse programmers, we wouldn't have very many features. The fact something isn't useful to you, or only very rarely useful, doesn't mean it should be snipped. If it's not relevant anymore, don't use it; the end.
 
Today, I was working in the kitchen and cut myself with a knife. I shall call that knife "C++" henceforth.
 
Xeo
from Fred's earlier linked question on Programmers.SE
 
One time I was walking out of my room and C++ pushed me on my face.
 
Xeo
I just saw a user on SO that had the name "C--" :)
 
@Xeo The language C-- actually exists! It's a stripped-down version of C better suited as a target for compilers of higher-level languages.
 
10:08 PM
I am fine with dangerious stuff and not taking away things from good developers.
 
Xeo
@FredOverflow Wait, what?
 
But here I am thinking. Never needed it before.
 
It does.
 
Not going to need it in the future.
 
Java went the way of removing 'confusing' stuff.
 
Xeo
10:09 PM
Yeah, and see what they got.
 
I'm starting to dig Java. :o
 
And then they started adding it back.
 
I already have a thousand bullets ready to shoot myself with. No need to add more.
 
Xeo
If you remove the confusing stuff, you also remove power.
 
That's not true.
@Xeo C-- is intended to be a portable assembly, a target output for new compilers.
 
10:10 PM
@GMan Heresy!
 
:D
 
If you are going to add stuff make it worth while. I don;t want to die of a thousand papercuts. I would like to die by landmine.
 
You can always play Minesweeper.
 
What do we have here?
lol, sweet.
 
Xeo
10:20 PM
If we're already throwing in YT vids:
 
I just blue screened my virtual machine.
 
@GMan A mix of two things you wouldn't think could blend well together. Just like C++!
 
@FredOverflow What's C++ a blend of?
 
C and OO.
 
Define OO. :)
 
10:22 PM
Impossible :)
 
That thing.
 
Xeo
@GMan Oh Oh ...
 
Oh, that.
 
Everyone loves things.
 
You know, that paradigm with their "OOPS I did it again" conference or whatever it is called.
OOPSLA (Object-Oriented Programming, Systems, Languages & Applications) is an annual ACM research conference. OOPSLA mainly takes place in the United States, while the sister conference of OOPSLA, ECOOP, is typically held in Europe. It is operated by the Special Interest Group for Programming Languages (SIGPLAN) group of the Association for Computing Machinery (ACM). OOPSLA is an annual conference covering topics related to object-oriented programming systems, languages and applications. Like other conferences, OOPSLA offers various tracks and many simultaneous sessions, and thus has a ...
 
10:24 PM
They sure love acronyms.
 
My hope is here:
http://intranet.cs.man.ac.uk/Intranet_subweb/library/cstechrep/Abstracts/UMCS-92-4-3.html
 
Yeah, I wait for the aliens, too.
 
Fox Mulder is back!
 
"I believe."
 
Ugh, writing this crap drains my brain. What can be done by simple SQL queries have to be implemented from scratch on top of a stack and a queue. In other news, I'm developing a fondness for italics.
 
10:27 PM
Italics are all that.
 
They don't afraid of anything.
 
@PiotrLegnica computing in general loves TLA
 
And the more recursive the better.
 
@PiotrLegnica of yes, nothing wittier the a recursive acronym
 
"SO" stands for "SO overflow", right?
 
10:30 PM
To infinity and beyond!
 
Twice!
 
I have finally hit 10k for my Hons project ¬_¬ only been 'technically' working on it for 6 months and have about a week to finish it all
@PiotrLegnica Always though it should be to infinity and back again
 
@Martin Reading it now.
 
My assignment says the code shouldn't be redundant. Then why do we reimplement everything. ;(
 
Digging that UFO has the syntactic sugar whereby x.y(z) is y(x, y), always wanted this in C++. Gives things uniformity.
 
10:37 PM
@FredOverflow FO sho (where FO stands for FredOverflow Overflow)
 
@GMan what the devil o_0
 
@PiotrLegnica Because we did not build it, we need to redo it correctly.
 
@JamesMcNellis What does "sho" stand for? :)
 
@thecoshman See Martins link to a new language above, abbreviated UFO.
 
@FredOverflow "Sho helps ovulation"
@GMan ahh, distraction... thanks, but no thanks :P
 
10:41 PM
@FredOverflow "fo sho" is hip-hop (or some other pop culture thing) for "for sure."
 
@JamesMcNellis nah, sho stands for "sho helps ovulation"
 
sh with objects.
Now that would be scary.
 
@PiotrLegnica :O give that man a cookie! I applaud thee <claps>
 
myfolder.cd()
 
it must be a sign of my youth that when I see cd my first thought is compact disc, not change directory (like it should be)
 
10:45 PM
That's too tame for shells (seriously, bash's syntax for variable expansion is a source of nightmares).
 
Hm, should operator++(C, int) be a valid alias for the language C++?
Or would you prefer C.operator++(int)?
 
C has no operator overloading!
 
But C++ does :)
 
I'd be in favor of renaming the room Lounge<&C.operator++>
 
Turtles all the way down.
 
10:48 PM
gasp!
 
I vote for turtles.
 
@JamesMcNellis &c.operator++ is ambiguous if both prefix and postfix versions are implemented as members.
But you can probably cast that ambiguity away :)
Also, I believe you and I really mean C::operator++ ;-)
 
Xeo
damn only 1 comment per 15sec..
 
8
Q: When do I use a dot, arrow, or double colon to refer to members of a class in C++?

sbiComing from other C-derived languages (like Java or C#) to C++, it is at first very confusing that C++ has three ways to refer to members of a class: a::b, a.b, and a->b. When do I use which one of these operators? (Note: This is meant to be an entry to Stack Overflow's C++ FAQ. If you want...

 
Lounge!(C++) :)
 
10:51 PM
Yay, D :)
D has a funny template instantiation syntax.
 
@FredOverflow It's that cursed^H^H^H^H^H^H awesome C# affecting my ability to recognize and write syntactically correct C++.
 
Yeah, it took me a bit to get used to it.
 
Doc
2
 
@FredOverflow hmm... what can you do with overloading -> ? make it return a pointer some other objects? such a->b is sort of the same (if we ignore the pointers here) a.c.b ?
 
@thecoshman Overloading -> is very special :)
 
10:58 PM
It's iterative.
 
It's pointerific
 
@FredOverflow it sounds like fun! :D <plays with something innocently> <blows lower hald of torso away>
 
When operator-> is used, -> is applied to the result. This continues until you reach a pointer.
 
@Doc That video is f***ing incredible!
 
Doc
@FredOverflow Glad you like it. I agree
 
10:59 PM
I already knew it, but thanks for the reminder.
 
@GMan ... I ... what?
 
Doc
:)
 
@thecoshman a->b is resolved to a.operator->()->b.
 
struct foo { const foo* operator->() const { return this; } void bar() const {} } f; f->bar(); // f.operator->()->bar();
 
@FredOverflow so that a::operator->() can return a pointer say, an instance of type c?
 
11:02 PM
@thecoshman You can return a pointer to anything you want.
 
@FredOverflow But it must be a pointer.
 
@Martin Or a UDT that overloads ->
 
@FredOverflow sounds like one of these things that you 'can' do, but you will more or less never ever need to do so
 
@thecoshman Why not? shared_ptr<T>::operator->() returns a T* which seems pretty useful to me.
 
@FredOverflow yes... cose I totally don't still use reckless pointers all the time < shifty eyes>
 
11:04 PM
Microsoft Internet Explorer: malware trap. Google Chrome: built-in malware updater. Mozilla Firefox: is malware itself, the big memory glut. Opera: has crossed over to Firefox-land, and also not nice with supporting Chinese censorship. Which browser have I missed (not counting variations on those mentioned)?
 
Xeo
@thecoshman One of those is overloading operator->*
 
@AlfPSteinbach Well, do you specifically mean Google Chome, or the Chromium base?
 
@GMan not sure?
 
@FredOverflow Unfortuntely not.
It must be a pointer.
 
@AlfPSteinbach Same here, I only know the names. :)
@Martin, no it could be another UDT.
 
11:06 PM
@FredOverflow: Just tried that:

#include <iostream>

class Y
{
public:
void doX() { std::cout << "Plop\n"; }
};
class X
{
public:
Y* operator->() { static Y y; return &y;}
};
class Z
{
public:
X* operator->() {static X x; return &x;}
};



int main()
{
Z z;
z->doX();
}
 
The alleged 'malware updater' is Google Update and it doesn't come with Chromium (or at least Chromium can be built without it — see SRWare Iron).
 
@Martin Where's your test? Either way, you break chaining because you're always returning a pointer.
@Martin @thecoshman @FredOverflow ideone.com/RNJke
 
@GMan OK. Got it.
 
@Martin Okay. (Also, sorry, didn't see the scroll bar for your code, w.r.t. the test!)
 
That is some mad shit right there! I lubs C++ :D
 
11:12 PM
It has to eventually return a pointer.
 
Yup.
 
#include <iostream>

struct X
{
void doX() { std::cout << "Plop\n"; }
};
struct Y
{
X* operator->() { static X x; return &x;}
};
struct Z
{
Y operator->() {static Y y; return y;}
};



int main()
{
Z z;
z->doX();
}
The intricacies of English: "Who though fruit flies like bananas"
 
how well dose VS handle you trying to do this btw? I imagine intelisense will look at that and proclaim that z::dotX(); is not defined
 
@thecoshman Well, z::dotX() is not defined :)
 
@GMan It's more interesting with a greater number of proxy objects...
(This is shitty for editing code)
 
11:15 PM
but calling z->dotX(); is valid, will intelisense let you do this with out moaning
 
"inelisnse"
@DavidRodríguezdribeas Agreed.
 
// sketch
template <typename T>
struct locker {
   locker( T & t ) : obj(t) { obj.mtx.acquire(); }
   ~locker() { obj.mtx.release(); }
   T* operator->() { return &obj; }
   T & obj;
};
template <typename T>
class locking_pointer {
   T * ptr;
// common smart pointer operations...
   locker<T> operator->() { return locker<T>(*ptr); }
};
struct type {
   mutex mtx;
   void foo() { std::cout << "critical section" << std::endl; }
   void bar() { std::cout << "another critical section" << std::endl; }
I first read that from Alexandrescu... and he also used in the article referred in this question (of mine, self promotion if that is allowed here :P)
13
Q: May volatile be in user defined types to help writing thread-safe code

David Rodríguez - dribeasI know, it has been made quite clear in a couple of questions/answers before, that volatile is related to the visible state of the c++ memory model and not to multithreading. On the other hand, this article by Alexandrescu uses the volatile keyword not as a runtime feature but rather as a compil...

Disclaimer, the question is best understood after reading the linked article, and from the time I wrote the answer until now, I have learnt enough to know that it is a great example of out-of-the-box thinking, but not that useful.
 
<yawns> I'm of to bed now -_- see ya!
 
@DavidRodríguezdribeas That locking thing is neato.
 
@GMan The short coming is that you cannot really control the granularity of the locks, that is, you lock for the whole function or not lock at all, which in many cases might not be the best approach. A nice thing there is that you move thread safety to be an external responsibility...
I'm going to rest now... got to get up early tomorrow, and it's already past midnight. Cheers
 
11:32 PM
See ya.
Would be interesting to see a language that had language-level support for self-modifying code.
 
Lisp?
 
That's clearly cheating.
 
11:57 PM
Perl. You can rewire the class hierarchy at runtime
 
Hi all ! While copying files from a directory to another, I am getting permission denied for some files while some files are getting copied. I am using cp linux command and these are cpp source files
What might be possibly wrong ?
 
Type the exact command here.
 
03:00 - 21:0021:00 - 00:00

« first day (170 days earlier)      last day (4796 days later) »