« first day (442 days earlier)      last day (4505 days later) » 

10:00 PM
@sbi I pay my mother 10 EUR per hour to clean my apartment.
Not kidding.
 
sbi
Oh boy, you got this all so wrong.
 
How?
I finally found a way to stop my suffering in this mess..
 
sbi
No, you found a way to prolong it.
This wrong on so many levels, I really don't know where to start.
Lemme try...
 
Well, I don't live in order to live up to your standards.
 
sbi
@StackedCrooked My standards about a clean apartment are so low, I wouldn't recommend you to stay here, with your dust allergy.
 
10:04 PM
@sbi My apartment probably has more dust atm than yours. So no worries.
I've looked into transport. Perhaps train is a good solution.
I don't have a car. I can borrow a car from my mother's new husband. But I'm not sure if he'll like the idea of me driving it to Berlin and back.
And flying, as Tony did. I don't know. That
hurts my ears too much :D
 
Xeo
Chew some gum or something
 
I'm chewing gum like a crazy man.
 
Would there be a good reason not to provide a conversion operator to a pointer of the same type
like class Test { operator Test*() { return this; } };
 
It helps a little, but not enough. I can't hear clearly for up to 12 hours after the flight.
 
sbi
@StackedCrooked What I mean is: 1) If your mother doesn't pay you to clean your apartment yourself, you have been training her wrong. 2) €10/hr is a slaver's price, so you should demand more. 3) Have you given given up on finding a woman to do that? Evil grin.
@SethCarnegie There's never a good reason to provide any implicit conversion operator.
 
10:08 PM
Besides that
 
The thing is, I don't clean. After many months of suffering I may find the courage to finally clean it all up. But then the history repeats itself. In the end I'm tired of it and decided to start throwing money at the problem.
 
sbi
@StackedCrooked Train ain't bad, but ISTR @Tony looking into that and shunning the time it takes to go by train. If you're willing to invest that time, it's a good way to travel, I think.
@StackedCrooked But that's avoiding the problem, rather than solving it. :) (Trust me, I know what I'm saying on that...)
 
@sbi It's about 8 hours.
 
sbi
@StackedCrooked One way? Not bad if you do this at night and can sleep 7 of those. That's not cheap, though, I suppose.
 
@sbi I don't believe you.
Never mind.
 
10:11 PM
flying to Berlin? expensive
 
@DeadMG I'm considering to go by train.
 
through which countries?
 
I'm in Belgium.
 
that might not be so bad
 
10:13 PM
@DeadMG you should go by train to Brussels where join to proceed to Berlin.
 
what, I?
 
@sbi Nice :D
 
If you plan to sleep on the train, take a hint from someone with experience: ask someone to wake you up before your stop.
 
I certainly can't afford any such
 
@DeadMG Yeah, who else.
 
Ell
10:14 PM
hi again guys
 
@DeadMG Hm, I think it'll be around 170 EUR for me (2 way).
@DeadMG So for you it'll be around 300 EUR. That's indeed a hefty price for a brief meetup.
 
sbi
@StackedCrooked Well, you're certainly welcome to sleep in my apartment, if you dare to. If we do this the weekend we spoke about last night, there'll be no kids here in the morning.
 
@sbi Is the dust so bad? Perhaps I should ask my doc for some antihistamines.
I don't mind kids.
Unless they poop.
 
lol
I'm sure they poop.
 
I think that everyone poops
 
sbi
10:16 PM
@StackedCrooked I mind them waking me up in the morning when I've been out at night, and I am sure so would you.
 
Well. I mean, poop in a non-civilized way.
 
sbi
@StackedCrooked Erm. How did you just do this?? Hey! I demand an answer!
 
lol
the ancient Romans used to measure the worth of their society by how far their shit ended up from the original shitter
 
@sbi I tell him that I'll visit a friend whose house is very dusty and ask if there is anything he can prescribe me to help me out.
@sbi Doctors generally like to prescribe medication.
 
sbi
@StackedCrooked Stop pulling my leg and explain how you linked to a message in the future without editing.
 
10:19 PM
@DeadMG I assume that were the loser Romans.
 
@sbi He didn't.
Pretty simple.
 
Xeo
@sbi What?
 
@StackedCrooked A pretty sanitary idea, though
 
sbi
@RMartinhoFernandes Darn. I just reloaded the page and now the messages are switched.
 
@sbi I don't know what you are talking about.
 
10:20 PM
@sbi Yeah, right.
 
still
 
Xeo
@DeadMG test
 
sbi
@StackedCrooked Before I reloaded, FF would show me your reply before my message you replied to.
 
Xeo
Now let's wait
 
I'm going to surprise everyone, including myself, by going to bed at a reasonable time
 
10:20 PM
Shouldn't drink that much.
 
Xeo
Ah, won't do without edit
too bad
 
@RMartinhoFernandes I know!
 
@Xeo It won't get linked without editing, even if you guess your own message ID.
 
@sbi Ah, that's a bug in chat.
It sometimes orders messages wrong.
 
It'll link for you, but not for anyone else.
 
10:21 PM
Dammit, I want to link to the future now.
 
sbi
@Xeo This works, but 1) you have to edit, and 2) that message ID might end up belonging to a message in some other room.
@RMartinhoFernandes I had never noticed that.
 
@RMartinhoFernandes Haha, I did it!
 
sbi
Wow, this was weird. Like Mrs. Cake.
 
sbi
@StackedCrooked Yeah, this works. We found out about that in fall 2009.
 
10:23 PM
Cake is a lie.
 
sbi
@RMartinhoFernandes Oh, did I get her name wrong?
 
@sbi Dammit, I'm late to the party again.
 
@sbi Given your track record today, that's likely :) . But I don't know who you're talking about.
 
The cake is a pie.
 
sbi
Isn't that the one who answers the questions before they are asked?
 
10:25 PM
Now you know I haven't read none of Reaper Man or Men at Arms.
 
If you want a interesting psycho talk then you should check out Esther Hicks.
 
Can someone help me out ?
 
@Sidar Sure..
 
=(
 
sbi
@Sidar How can we know if we don't know what your problem is?
@RMartinhoFernandes Ah, for some reason i thought you have read them all. Now I envy you.
 
10:26 PM
100 rep says it's undefined behaviour.
 
I know you can help me, Just wondering if there was someone...
 
@Sidar You need help knotting your tie?
 
sbi
@RMartinhoFernandes Who is 100 rep and why is he saying this?
 
user406009
Don't ask to ask, just ask.
 
I have a friend declaration in a header. And then when i try to implement it in my cpp file it gives me about the function not being within a class
 
10:27 PM
@sbi You are misunderstanding.
 
an error about*
 
sbi
@StackedCrooked No, I'm sbi.
 
@Sidar Go on..
 
@Sidar Can you show some of the code in question?
 
error: friend declaration not in class definition
 
sbi
10:28 PM
@StackedCrooked To be fair, we had been speaking of the paranormal when he entered...
 
in the header > friend ostream & operator << (ostream& output, Color& color);
 
@StackedCrooked Thank you for taking the troll-bait that was thrown my way.
 
@Sidar you your compiler say so, it's truth
 
implementation
friend ostream & operator << (ostream& output, Color& color){

output << color.toString();

return output;
}
 
@RMartinhoFernandes Always glad to help out a friend.
 
10:29 PM
remove the friend on impl
 
user406009
No use of the word friend in implementation.
 
sbi
@Sidar If you want help with this, you will have to boil this down to a piece of preferably no more than 20 lines of code which reproduce the problem.
 
sigh...Coming from Java C++ really knows how to kick me in the balls
Thats all the code there is sbi
 
@DeadMG or just interpret it
 
sbi
10:30 PM
@StackedCrooked Did you just declare the robot a friend of yours? Can it now touch your private parts?
 
Thank both of you you, it works
 
sbi
@Sidar Oh.
 
@sbi Gosh, no.
 
Thanks, both of you. It works.
 
@sbi Hell no. Those are in a pimpl!
 
10:30 PM
LOL
 
sbi
@Sidar @Sidar, this code is wrong.
 
We are living in troubling times. Google Code Search will be shut down soon.
 
Not anymore!
 
@sbi Well, he nows that!
 
@StackedCrooked Related, I guess.
 
10:31 PM
room topic changed to Lounge<C++>: C++: it knows how to kick you in the balls [c++] [c++11] [c++-faq]
 
sbi
@Sidar Yes, it is. You do not want to change the color when printing it, so it needs to be const.
 
No then it will give me a new error
 
sbi
@RMartinhoFernandes Damn, the old one was sooo nice.
 
@CatPlusPlus Related to what? .. Ah the secret. Yeah, that's crap.
 
sbi
@Sidar Then you will have to fix that error.
 
10:32 PM
toString should be const
 
Elaborate on why it is wrong. It's not like I'll perform more stuff in there other than calling the toString
 
Xeo
@Sidar Sure, but outputting something, aka reading from it doesn't change state. as such, make it const
 
sbi
@Sidar: See this FAQ entry. It shows tha canonical signature of an out put operator for a type T as std::ostream& operator<<(std::ostream& os, const T& obj). And that's what yours should look like.
 
user406009
Of course Java does not have real constants. Stupid Java.
 
Xeo
Const-correctness is an important part of idiomatic C++
 
10:33 PM
when you start to write something in C++, every line is wrong.
 
@sbi Right, wielding little girls sounds really nice.
 
Java doesn't have constants??
 
error: passing const Color' as this' argument of `const std::string Color::toString()' discards qualifiers
 
sbi
@Sidar You cannot pass a color literal to your version (if such beasts exist).
 
10:33 PM
> Const-correctness is an important part of diplomatic C++.
(Fixed.)
 
Xeo
@Sidar make toString() const
 
I did =/
 
std::string toString() const;?
 
Xeo
No, you made the return type const
 
sbi
@Sidar That's because Color::toString() must be declared to not alter the object it's called for. You do this by appending a const to its sig.
 
Xeo
10:34 PM
See @RMartinho's message
 
@sbi Also, at first I read it as "welding" little girls. That sounds even less nice.
 
Ok...now it works
 
sbi
@Sidar What book are you learning from?
 
Man, this stuff is really confusing =/
 
Xeo
@sbi inb4: none
 
10:35 PM
That's the point, isn't it?
 
whole C++ is really confusing
 
sbi
4
Q: What is the meaning of a const at end of a member function?

MatWhat exactly does the const keyword in C++ mean when it's written at the end of a member function (after the argument list)?

 
so why do both toString and the parameter have to be const?
thanks
 
Xeo
Because they don't change the visible state of the object
 
just because they can be const
 
sbi
10:36 PM
@Xeo ??
 
Returning const values is silly.
 
Returning silly values is const.
 
Xeo
@sbi "in before he says 'none'"
 
@xeo, I understand that. But I don't see why both of them have to be const...
 
Xeo
@CatPlusPlus Yep, disables move semantics
 
sbi
10:36 PM
@Sidar It's a way for the compiler to help you avoiding to blow your foot off. If you are not meant to change something, make it const. If you fail, the compiler will catch you at it.
 
Xeo
@Sidar Because only const member functions can be called on const objects
 
btw, what const in const T foo(); actually does?
 
Xeo
make the return type const, it's useless and harmful
 
Makes the return value const.
 
I failed twice for my C++ test... both 5/10. I feel like an idiot
okai @xeo, I guess ill just have to accept that
Makes sense too then...I guess
 
Xeo
10:38 PM
room topic changed to Lounge<C++>: C++: it knows how to kick you in the balls while shooting your foot. [c++] [c++11] [c++-faq]
 
sbi
@Sidar Don't sweat over it. I have taught C++ to many student who had a year of exposure to Java. They do have a very hard time.
 
Ell
guys
 
Xeo
@Sidar, read up on const-correctness here
 
room topic changed to Lounge<C++>: C++: it knows how to kick you in the balls while shooting your foot and stealing your wallet. [c++] [c++11] [c++-faq]
 
@Xeo That's preferable to to kicking you in the foot and shooting...
 
sbi
10:39 PM
@Abyx The only thing it effectively does is to prevent you from calling non-const member function on the returned object.
 
Xeo
@sbi And it disables move semantics.
 
And screws up moving.
 
Xeo
And it is suck.
 
but returned object can be copied to non-const?
 
sbi
10:40 PM
@CatPlusPlus What about female programmers? Are they kicked into their balls, too?
 
Ell
yep
 
@Abyx Yes, but not moved.
 
mmmm the a pointer is ouputted as the memory adress.
using the & doesn't work either.
 
What?
 
sbi
@Sidar That would give you a pointer to a pointer... — which is a pointer, too.
 
10:41 PM
never mind
 
What does toString return?
 
Xeo
room topic changed to Lounge<C++>: C++: it knows how to kick you in the balls while shooting your foot and stealing your wallet and it is suck. [c++] [c++11] [c++-faq]
 
Colors[ string::_M_replace_aux,green:,blue:,alpha:]
 
Ell
hmmm
 
Wait, what.
 
Ell
10:41 PM
I have a template class that contains T* mValue
 
Xeo
@Sidar Ehm, what?
 
sbi
@Ell You have a class template.
 
Can I say "what?" too?
 
Xeo
You just did
 
Ell
10:42 PM
and for all of the operators it just delegates it to the containted object
 
sbi
@Xeo Damn.
 
Ell
@sbi yes - sorry
 
Who's Ypu?
 
Ell
how can I delegate the subscript operator?
 
Xeo
Damn @Cat, don't steal my sentences
 
10:42 PM
@sbi No, I didn't! I quoted myself not saying it.
 
sbi
@RMartinhoFernandes You quoted yourself saying it.
 
@xeo, I didn't convert my unsigned ints to string
 
@Ell blah->operator[](x) or (*blah)[x].
 
Xeo
@Ell ? T& operator[](int i){ return (*ptr)[i]; } ?!
 
Ell
isnt the signature like this?
 
10:43 PM
Its a Java/C#/AS3 habbit to just concat anything to String with +
 
(*blah)[x]
 
Ell
R& T::operator [](const T2& b);
 
So that didn't work lol
 
Xeo
Or what do you mean?
 
Ell
on wikipedia it says that anyway :P
but I only have one type?
 
Xeo
10:43 PM
You worry too much
 
@Ell try mValue->operator[](idx);
 
sbi
BTW, @Sidar, you got this whole stringifying thing the wrong way around. In C++, the stream operation is the primary. It's where the conversion is implemented. If we need a to_string() function, we just stream into a string stream and return the content of its buffer. So to_string() needs to call operator<<(), not the other way around.
 
Ell
No i mean - what will be the signature of it?
 
@sbi But there is a std::to_string function!
 
Ell
let me show you , one moment.
 
10:44 PM
It's an assignment, really Im just trying to get my grade in.
 
this chat it so multi-threaded %)
 
I wonder why they added to_string instead of something like boost::lexical_cast.
 
I don't want to output the toString directly though
It returns a string
 
sbi
@RMartinhoFernandes Really? I'm not up to date as to C++11. Hangs head.
 
10:46 PM
@sbi Can I ask how did you review Scott's C++11 materials?
 
Ell
^^ yes Im a complete C++ noob
 
@sbi, I'm not really getting it though
 
Use ctor init list to initialise data members.
 
http://notfaq.wordpress.com/2006/08/30/c-convert-int-to-string/

like so?
 
Also just provide conversion operator to T& and const T&.
 
sbi
10:47 PM
@Sidar In Java, you write a toString() and call that when you want to output something. In C++, you write an output operator and call that (on a string stream) if you need a string of something.
 
@Ell I hope you didn't forget to write the destructor and friends.
 
You override the toString though in java
 
Chat has data races too.
 
sbi
@RMartinhoFernandes I read it, tried to make sense of it, scribbled notes into the margin, and sent those notes to him. That was years ago, though. Remember, I have been forced to waste my talent on C# for two years. Weeps.
 
Also that constructor doesn't make much sense.
 
10:48 PM
@RMartinhoFernandes I hope so too crosses fingers...
 
You're trying to assign value to a pointer.
 
@RMartinhoFernandes chat scrolls too fast (or it's really a race) it was to Ell
 
Ell
@RMartinhoFernandes I havent got to that yet - I'm struggling what signature I can give the subscript operator
@CatPlusPlus for me?
 
Ok, just checking.
 
Ell
10:49 PM
yeah it doenst make much sense. Darn o.O
 
@sbi See, that's what I did. I learned git just to get better at C++. I now think C++ is easy as pie
2
 
Xeo
@Ell Well, do you have access to C++11 decltype?
Otherwise it's going to get a bit hairy.
 
@Xeo Kids these days. Can't live without C++11 already...
7
 
Ell
@Xeo errrm Im using g++ 4.6.1 (mingw) so I think so?
 
Xeo
Then:
 
sbi
10:50 PM
@Xeo Oh, hairy porn. Tony's bound to appear any second now.
 
@sbi Gosh, what's going on your mind?
 
@RMartinhoFernandes It's drama!
 
@sbi
I've turned toString to this now:

string Color::toString() const{

std::stringstream out;
out << "Colors[ red:" << g << ",green:" << r << ",blue:"
<< b << ",alpha:" << a << "]";

return out.str();
}
 
template <typename T2>
auto operator[](T2 const& b) -> decltype((*mValue)[b]) {
    return (*mValue)[b];
}
 
Ell
thank you!
now I will try to figure this out
 
Xeo
10:52 PM
template<class IndexType>
auto operator[](IndexType const& index)
  -> decltype((*ptr)[index])
{
  return (*ptr)[index];
}
 
Ell
I'm not familiar with the -> in a function decleration?
 
@Xeo Ha, too late.
 
Xeo
late specified return type
 
@Ell It's a "trailing return type".
 
Xeo
also trailing return type
 
Ell
10:53 PM
okay that seems simple enough
 
Xeo
@RMartinhoFernandes Mine contains the template declaration atleast!
 
trailing return type violates DRY principle =\
 
sbi
Better yet, implement `operator<<()` to output `"Colors[ red:" << g << ",green:" << r << ",blue:"
<< b << ",alpha:" << a << "]"` and call that as `out << *this`.
 
Mine can be pasted as is, even the member variable names are right.
 
Ell
10:54 PM
@abyx howcome? o.O
 
Xeo
@Ell You have access to the parameters and class members in the trailing return type, which allows you to express the stuff in decltype way more concise than otherwise
 
sbi
@RMartinhoFernandes Whistles...
 
Xeo
@RMartinhoFernandes Ah, you edited that in! :s
 
@Ell with it you write same thing twice
 
@StackedCrooked git submodules. you can record a submodule update into a commit :)
 
10:54 PM
So I should just remove the toString?
 
Xeo
@Abyx Yeah, nothing you can do about that though
 
Ell
@abyx oh yeah i realise now - I just saw it :s
 
@sehe Hmm. Interesting I guess.
 
@sehe svn:externals are versioned too.
 
@StackedCrooked yup loads of times; I used it on AIX mainly because git wasn't able to ./configure && make install when I worked on it. It was really quite decent. But sloooow
 
Ell
10:55 PM
is there any way in c++ you can do what I'm trying to do but quicker? (delegate all the functions - facade pattern almost)
 
And you know what, svn:externals are easy to remove.
 
Xeo
@Ell Inherit from the type and use C++11 inheriting constructors.
 
@Ell Overload operator-> and always use -> instead of ..
 
@RMartinhoFernandes your point being?
 
@Ell overload only -> and *, like smart pointers does
 
Ell
10:56 PM
@Xeo you cant inherit from native types can you?
 
Xeo
@Ell Yeah, you'll need to distinguish that with a partial specialization
 
@sehe Nothing, really, just something I realized. But I mean to say that git submodules wouldn't have helped in his situation.
 
Ell
@abyx i only have to override -> and *?
but then it wont funciton as a value then will it? only as a reference?
 
Xeo
@Ell If you're implementing a pointer-like wrapper
 
@Ell as pointer
 
10:58 PM
It functions the same, except you can't call functions on it with the dot ., only with the arrow ->.
 
@sbi
ostream & operator <<(ostream& output, const Color& color) {

output << "Colors[red: " << color.g << ",green: " << color.r
<< ",blue: " << color.b << ",alpha: " << color.a << "] " << color.color();

return output;
}

This should do it then
 
Markdown hurts my eyes.
 
Ell
@xeo I'm trying to get this to behave like a value :s not sure if its possible
 
You don't need to print the color names.
 
Well some do ARGB
in this case it's
 
10:59 PM
@Ell To get that value-like behaviour you need copiers and destructors.
 
RGBA
 
Ell
@abyx sorry I have a bad habit of saying reference in the general term instead of differenciating between references and pointers in a c++ context
 
sbi
@Sidar Yup. And you call this on a string stream from your toString() function, should you still need it.
 

« first day (442 days earlier)      last day (4505 days later) »