« first day (315 days earlier)      last day (4634 days later) » 
00:00 - 16:0016:00 - 00:00

12:23 AM
3
Q: Dominance in virtual inheritance

Alf P. SteinbachWhat are the C++98/C++03 standard's and the C++0x future standard's exact rules for dominance in virtual inheritance? I'm not asking for just the specific paragraphs, although I'm asking also for that (somewhere in section 10, I'd guess). I'm asking also for the consequences of the standardeese...

still no answer, and i think now it's been hours. hah.
 
 
9 hours later…
9:36 AM
morning all!
 
howdy
 
how are ya today?
 
morning
 
what does today bring?
 
oof, need to debug some code for my old job. Need to get my bike fixed. Want to find a café somewhere and slack and code on hobby stuff for a few hours. And a ton of other things. If I have time, I think I'll go swimming too
 
9:49 AM
ohhh lots to do eh
 
how about you?
 
hmmm I've got to wrap my head round SFINAE today and I'm gonna watch this Channel 9 video I downloaded, and there's no plans for the rest
 
sounds good
 
Good morning.
 
morning
 
10:33 AM
Yay, I got the Taxonomist badge! I'm pretty sure I wasn't the original creator of that tag, but whatever.
My inner Linnaeus is pleased.
 
creator?
 
Creator, the dude that used it for the first time.
 
11:09 AM
hmm
doesn't look like "shitstorm of C++ masochists"
ohh soon we will have 2million questions on SO?
 
11:28 AM
woah it's quiet here
 
YEAH, LET'S MAKE SOME NOISE.
 
:)
anyone heard of C++ AMP?
or seen Herb's talk on it?
 
no
what is it?
 
AMP?
what's this
 
11:32 AM
"Alf's Magnificent Powerclasses"
hu
 
seems to be a GP GPU framework
 
Yeah, from what I've gathered, it's kind of a Cuda for modern C++
 
yea, sounds like that, I'm gonna watch Herb Sutter's talk on it :)
 
Hey, it doesn't print "Hello World!".
;)
 
11:34 AM
no, the Hello World for GPGPU is like matrix multiplication :p
 
1
Q: unexpected behavior of bitwise shifting using gcc

puffadderI have a test program like this: int main() { unsigned n = 32; printf("ans << 32 = 0x%X\n", (~0x0U) << 32); printf("ans >> 32 = 0x%X\n", (~0x0U) >> 32); printf("ans << n(32) = 0x%X\n", (~0x0U) << n); printf("ans >> n(32) = 0x%X\n"...

?
 
It's UB, but I'm really curious about WTF is GCC doing to produce a zigamorph instead of zero.
Ah, ok, @Dietrich explained in the comments.
 
11:52 AM
zigamorph?
 
I expanded the definition to include other bit sizes :)
 
Guys, I just came here shortly to say goodbye. Lately, I have just become so tired of having to deal with all the complicated crap in C++ that gets you nowhere in the end. I am now in the process of converting into a pure Haskell programmer, striving to reach ultimate enlightenment in the nirvana of Monads.
It was fun while it lasted. See ya, and don't let undefined behavior bugs bite you in the night!
 
have fun :)
 
@FredOverflow Nice try. You wouldn't need to say goodbye to us because of that.
Damn, I can't get my relative_ptr to work as I want without making copying it UB.
 
what's it supposed to do?
 
11:58 AM
What's tricky about copying?
 
Wait, maybe I can.
@LucDanton It stores only an offset.
A copy of it, will point somewhere else.
 
Go on.
I don't get it. Well the offset I do, it's the copying.
 
@jalf It's a pointer as an offset, so I can keep it in a memory-mapped file, for example.
@LucDanton To keep it trivially copyable, I can't have my own copy ctor.
I need it trivially copyable, no?
 
Ouch. And you want the triviality to mmap without worrying?
 
12:03 PM
Well, for what part of the class invariants/logical state do you need more than a bare copy to transfer to the new object?
 
relative_ptr<int> p1 = blah;
auto p2 = p1;
Consider this.
If p1 gets offset = 42, p2 will have it as well.
 
And is the base of the offset this or what?
 
p1 points to reinterpret_cast<char*>(&p1)+42, while p2 points to reinterpret_cast<char*>(&p2)+42.
@LucDanton Yes.
 
Well okay.
Why not make this part of the state? Then it's copied too.
 
12:07 PM
@FredOverflow Once in C++ you can never leave, even if you think you've left, you really haven't :P
 
@RMartinhoFernandes Oh, my brain is just going through one of this pure phases. But don't worry, my penis still thinks in C++!
@TonyTheTiger Sc++ientology? :)
 
@FredOverflow lol
 
welcome to the hotel C++ ... You can checkout any time you like, But you can never leave
5
 
The only languages I have ever truly abandoned are Basic and Pascal, I think. But they were great first stepping stones
 
so you're not really sure you've abandoned them?
 
12:10 PM
@LucDanton That will make copies work. But if I open the mmaped file later on, I need to know to ignore the base.
 
I abandoned PHP after the first line of code, never looked back :)
 
@TonyTheTiger What was it? echo "Hello World!" || die()?
 
@RMartinhoFernandes Ah, trivially copyable but persistent copies are meaningless. Tricky.
 
@RMartinhoFernandes lol
 
@LucDanton Maybe I'm missing something, but there's nothing preventing me from making the copy ctor private, is there?
 
12:12 PM
I'm going to have that damn song stuck in my head all day now, but at least I got ★s to make up for it
 
@TonyTheTiger No I meant I can't remember any other language I have abandoned.
 
GCC still asserts its PODness with a private copy ctor.
 
@FredOverflow oh I see
 
@RMartinhoFernandes I don't know the C++0x requirements well enough.
 
@TonyTheTiger I also don't do Scheme and Prolog anymore, but since I didn't pick them up on my own will and only did them for a semester, they don't really count.
 
12:14 PM
oh I see
I tried Haskell once, got confused :(
cause I like the idea of Functional programming, just all this lambda calculus does my head in
 
Wow, that is really cool!
 
@FredOverflow I think the project is orphaned though.
 
@TonyTheTiger I never actually needed lambda calculus in Haskell. You probably mean lambda functions, right? Do you get lambda functions in C++?
 
how the devil does that work?
 
@FredOverflow Yes I do understand them in C++, however the way I got into Haskell was by watching Erik Meijer's video series on it, and he goes into some Lambda calculus, so perhaps that's where that comes from
 
12:17 PM
I like doing pointfree Haskell.
 
.free haskell?
 
I never got past monads in Haskell, although after template meta programing the rest of what I saw seemed very tidy
 
Just forget about Lambda calculus. Yes, it's the theoretical foundation of Haskell, but who cares? You don't even have the number 3 in lambda calculus, instead you write "λfx.f (f (f x))". How pathetic is that? ;)
 
I'm just getting into TMP
 
@LucDanton Well, I've been studying them for the past days, and I can't find such a restriction.
I think I'll go with that for now.
@TonyTheTiger Haskell without variables. Just compose functions directly.
 
12:18 PM
really writing some proper TMP code can be somewhat of a mind bender
@RMartinhoFernandes oh I see
 
Instead of doubleOfSquare x = double (square x), you'd write doubleOfSquare = double . square
 
@FredOverflow - in that coroutine where is the return. Or is it abusing exceptions/longjmp?
 
So, yes, pointfree does use more points (.) than pointwise :)
 
@TonyTheTiger Instead of saying \x -> sum x == target where you have a named lambda parameter x, you can also say (== target) . sum which has no such names. "No names" is called "point free". "Point free" has nothing to do with the dot symbol, which obviously appears in the second version.
 
12:21 PM
Whether or not point free is "better" is the subject of many heated discussions. I think it's cute :)
 
hehe @FredOverflow thx for the explanation
 
@awoodland It's magic! :) Honestly, I have no idea.
 
room topic changed to Lounge<C++>: Welcome to Hotel C++. You can checkout any time you like, but you can never leave. [c++] [c++11] [c++-faq]
Whatever.
 
Why no "the"?
 
Messed up. Again.
 
12:23 PM
damnnit :(
 
Also, isn't it "check out" instead of "checkout"?
 
room topic changed to Lounge<C++>: Welcome to the Hotel C++. You can checkout any time you like, but you can never leave. [c++] [c++11] [c++-faq]
 
I'm watching Herb Sutter's talk on AMP C++, bye for now
 
@FredOverflow Stop that!
 
@RMartinhoFernandes "checkout" is a register, if I'm not mistaken. Like, a register in a supermarket where you pay. Not a register inside of a CPU :)
 
12:24 PM
> 2. The administrative procedure followed when a guest leaves a hotel at the end of a stay.
 
oh, ok, seems a legit abbrev. for "check out".
I like to abbrev. "abbrev.", it's so recursive!
 
Like TLAs?
 
I don't know what that is, but does the "T" stand for "TLA"?
 
No. Three.
 
12:27 PM
ah :)
 
> 1. Self-describing abbreviation for a species with which computing terminology is infested.
 
Jargon file entry?
 
I'm a sucker for the Jargon File.
 
Has anyone had experience with linux kernel timers ?
 
12:28 PM
UR in my jargon file
 
@kbok They run on my machine. Does that count? ;)
 
@RMartinhoFernandes It depends. Can you look into your machine and then explain to me how they works ?
 
:(
I found some documentation with ads in it. I'm a little bit afraid.
 
personally I'm more of a fan of the E-TLAs
 
12:48 PM
hm, i always associate eagles' "hotel california" with manfred mann's "chicago institute"
don't know why exactly
 
Wait, there's something wrong here. GCC 4.5 says I can't default a constructor in the class body if it's private.
But GCC 4.6 is happy.
 
@TonyTheTiger Thanks for reminding me of the series, I'm re-watching it right now.
 
Chat was down and I managed to go to shop, shave and start doing laundry. IOW chat outages are dangerous.
2
 
You killed your dwarven beard?
You murderer!
 
12:58 PM
Yeah, there was plenty of blood involved.
 
Als
Hmm..Full House..and its a saturday..No wonder anyone of y'all seems to have no social life
(me) Included.
 
I'm running out of friends.
 
Als
perhaps life too
:P
since yous spend most of your time here
 
No, I mean it. Everyone is going their own separate ways.
 
Als
That always happens doesn't it..
Life is dynamic..people change..choices change
 
1:04 PM
Chat is social, too.
 
I'm going to be social tomorrow.
playing board games at a hospital. That's a new one :D
 
I need to find a new batch of friends now. That's not going to be easy.
 
Als
Yeah...A cat saying chat is social is highlight of my social chat life
 
It's interacting with people, how is that not social?
 
Als
@jalf: At a hospital eh...What are you gonna do there?
 
1:06 PM
@CatPlusPlus It's easy mode social.
 
I always hear people go "you'd go outside and talk with some people". I'm already talking with people, dammit.
 
Als
@CatPlusPlus: this is not real, talking to the computer you silly cat
 
@jalf Cheering up a friend?
@Als How is this not real?
 
@Als How is that not real?
Lol.
 
I won.
This time.
 
1:07 PM
@RMartinhoFernandes You can always declare new friends.
 
Als
I don't know this thing i called Cat or Space Robot are what they say, cat maybe a cat for that matter
 
chatting is about as social as my life gets :P
 
Hell, I'm talking with people half across the world, you can't do that when sitting with 3 people in the same room.
People have a funny definition of 'social', which I personally don't get at all.
 
@FredOverflow Well, if they don't declare myself a friend too, and don't act like friends, it's not of much use to just declare them.
Their constructors are private.
 
Als
@jalf: I hope you didn't mean to say boning some nurse at the hospital are you :P
 
1:08 PM
Gosh. WTF.
 
so are we all loners that have nothing better to do on a Saturday, besides chat and write geeky C++ code?
 
Als
@TonyTheTiger: I concur
 
@TonyTheTiger I do. I write Haskell code.
 
I'm dying of heat.
 
@TonyTheTiger I'm a geek and I'm a loner. What's wrong with it?
 
1:09 PM
@RMartinhoFernandes both
 
You don't talk to people!
 
didn't say anything was wrong with, I'm just finding people to comiserate with my situation
 
Oh, wait.
 
You're not people.
 
Says robot.
 
1:10 PM
If there's nothing wrong, why comiserate?
 
Als
says cat
 
@Als nope , a friend ended up in hospital, so a bunch of us are going to see her tomorrow, and play some board games to cheer her up :)
 
cause it's lonely :p
 
I am Eliza 2011. Tell me about your problems!
 
The room is full!
 
1:10 PM
@jalf Huh, ok. But that's exactly what I said.
 
It's overflowing!
 
loneliness
 
Als
@FredOverflow: I remember that thingy hehe people used to have sex chat with that auto chat progroam
 
room overflow...
 
ack, I fail at this chat
 
1:11 PM
@TonyTheTiger I don't like never being alone.
 
ah well, it stopped raining. Off I go! New adventures await!
 
I want rain.
GIVE ME YOUR RAIN.
 
@RMartinhoFernandes I don't mind being alone, but it drives me nuts if its for days on end
 
Als
@jalf: Ah good or you would be an outcast, we are people here who are being denied, good work, good wine and good women.
 
@RMartinhoFernandes yeah, I meant to quote @Als
 
1:12 PM
Ah, I didn't check what message you replied to.
@TonyTheTiger Yeah, that kind sucks.
 
@CatPlusPlus is it really that hot where you are? I've only seen rain and cold since I've been back here
 
Stupid gregarious instincts.
 
Bloody sun is at the exact position where a window blind is missing, and I can't see half of my screen.
@TonyTheTiger Yes.
 
Which half? This one? ------------------------------------------------------------------------------------------ or this one?
 
1:14 PM
The lower half.
 
Als
ahh lower half
here we go again
damn pervs
 
@Als You are the perv!
 
I'm no perv
 
1:15 PM
pervasive?
 
It's about 28 degrees right now, but it feels like 35.
 
oh shush you
 
@Als You're always twisting everything we say into sex!
 
Als
@RMartinhoFernandes: Why me? @CatPlusPlus, said it
 
woah that's hot
 
1:16 PM
28ºC is not hot.
 
Als
@RMartinhoFernandes: huh, You measly people always mean sex
 
I'm not a perv, I just only think about sex :P
 
Als
@TonyTheTiger: Show the folks whats hot :P
haha
 
20 is not hot. 28 is.
 
@TonyTheTiger Yeah, like pervs do. ;)
 
Als
1:17 PM
sex!sex!sex!sex!sex!sex!
 
she's got a high head. OMG
 
Als
now that's hot you silly people
 
or perhaps that'S just the styled hair
 
Als
@JohannesSchaublitb: You know the C++ standard like ABCD book and you don't know her?
ah nerd!
 
1:19 PM
hmm
Jessica Alba.
dunno
 
Yeah. Says in the file name.
 
I find variadic templates a lot more appealing than Jessica Alba.
3
 
Als
@JohannesSchaublitb: you didn't knew eh
 
@FredOverflow agreed
she's not hot at all.
 
Well, variadic templates are not hot either.
They're not female humans, for starters.
 
1:21 PM
lulz
 
Als
huh....I vote for her.
 
variadic templates are hot like hell
 
you can't implement pure hotness in C++
 
Hot like hell is too hot.
 
@RMartinhoFernandes But variadic templates are so extremely generic, whereas Jessica Alba serves only a single purpose.
 
1:22 PM
variadic templates are the most pure hotness. they are pure like haskell
 
Apropos, what about template Haskell? Is that still in progress?
 
@FredOverflow Single purpose? Hot people are people too!
 
some people serve only a single purpose
 
Als
@FredOverflow: What single purpose? :P haha
 
1:26 PM
@Als constructing your little Bjarne?
 
Als
haha, You said it, I am the one just asking..
 
Als
What is little Bjarne?
lol, Is it just me that doesn't understand that or someone else too didn't
 
@Als He lives in your pants.
Jessica Alba turns ~ into /
 
uh oh...
 
Als
1:28 PM
@FredOverflow: Then it was constructed a lot of years ago, So no not constructing it now :P
 
so what is a weak memory model?
 
@FredOverflow You're gonna love DongML.
 
@Als s/construct/resize/
@TonyTheTiger Maybe a memory model without many guarantees? Where did you get the term?
 
@FredOverflow Herb mentions it in the talk I'm watching
 
That AMP talk or whatever it was?
 
1:31 PM
yea
 
And he doesn't understand what it means? Can't you derive from context?
 
wtf?
@FredOverflow I don't get what it means, I'm sure Herb does :)
 
See, @Tony wants to talk about C++. It's @Als that keeps wanting to talk about sex!
 
Als
@RMartinhoFernandes: hmm
 
1:33 PM
so there is this graph, and it talks about weak memory models and strong models, perhaps it helps putting the term into context
0
Q: Concurrency and memory models

Tony The TigerI'm watching this video by Herb Sutter on GPGPU and the new C++ AMP library. He is talking about memory models and mentions Weak Memory Models and then Strong Memory Models and I think he's referring to read/write ordering etc, but I am however not sure. Google turns up some interesting results...

if anyone knows the answer to my question, feel free to make an attempt! Free Rep!!! :)
 
1:51 PM
What's the bool parameter for?
Also, you cannot use the same specialization for string and string*, because you cannot call the methods the same way for both.
They're not ducks of each other :)
This line if (object.compare("Tony") == 0) would have to be if (object->compare("Tony") == 0) for string*.
 
@RMartinhoFernandes so you can do algorithm_selector<is_string<T>::value>(object); where is_string<T>::value returns a bool
@RMartinhoFernandes yea that's one of the things the compiler complains about if I try to do this
so I guess you'd need a specialization for a string and one for string* ?
 
hahh ok
 
@TonyTheTiger - I think you're right about what he's talking about and lxr.linux.no/#linux+v3.0.3/Documentation/memory-barriers.txt I think is a good document on the issues
I can't summarise it well enough to make a good answer though.
 
@RMartinhoFernandes so If I wanted to make a specialization for string pointers, how would I add that? Cause if I do algorithm_selector<true> then I'd have the same as this one and how would the compiler know what to pick?
 
1:57 PM
Ditch the bool parameter. Replace it with a type parameter instead.
And then you don't need a template member function. Only the class needs to be a template.
 
@RMartinhoFernandes just typename T then?
 
Yeah.
And then the specializations are easy to write.
 
but then there is no need for type_traits either?
 
Not really :)
 
oh ok
hmm, ok
 
2:02 PM
Did you want to use type traits to learn?
 
yea I was trying to learn how to use type traits, but I've no idea what I could write to learn it, this was an example I got from the internet, which I was attempting to expand on my own
 
2:16 PM
Why is this question closed ? even i wanted the answer for this. can some of you people plz vote to reopen it. i dont have that much of reputation.
http://stackoverflow.com/questions/7214950/c-code-to-detect-if-the-compiler-allows-comments-to-nest
 
> int puts();int main(){puts("no");}, i.e. a C compiler does not allow comments to nest. – R.. 2 mins ago
 
i know that
but the guy was asked to write a code to prove that :)
 
That is the solution.
@Tony: can you do this: ideone.com/GEaJf
 
@RMartinhoFernandes Non-nesting comments aren't exactly C's biggest problem :)
 
2:58 PM
@RMartinhoFernandes can you give me a hint? I just can't solve it?
:(
 
You need SFINAE.
(you can change the signature of the move function if you want).
 
3:12 PM
Here's a solution, with comments: ideone.com/Os0yU.
 
3:37 PM
@RMartinhoFernandes this is what I've got, and I haven't looked at your solution yet, so any comments?
the easy way would be to look at your solution, but I won't learn...
 
You're on the right track.
 
Hi all
 
You've got the argument to enable_if wrong.
The macro defines the trait specialization. You want to use is_flying and such directly.
 
@RMartinhoFernandes the macro you mean?
 
Expanding the macro gets you enable_if<template <> struct is_flying<T> : true_type {}> which is a syntax error.
You want enable_if<is_flying<T>::value>.
Sorry, if it got you confused with the macros :)
 
3:44 PM
Yesterday, myself and my colleague had a discussion. He asked me to say few names whom I know. I said most of your names terming as my friends and thought for a moment "Am I giving my access to you? "
Mutual friends ?
 
@RMartinhoFernandes yes the macros get me a bit confused, but also the true_type business, but I'm guessing this is getting closer to the solution
except that move has no argument matches and so it won't compile
 
@TonyTheTiger The true_type is just a shortcut to define a value member that is true by using inheritance.
 
hmm
@Mahesh huh? I fail to parse that?
 
So, if I need to say, that an eagle flies, I write template <> struct is_flying<eagle> : true_type {}; And it gets its value member from the true_type.
Instead of:
 
@TonyTheTiger - Looking for a mutual friend keyword in C++. Unlike the regular key word 'friend' in C++, which is not transitive by nature.
 
3:53 PM
template <>
struct is_flying<eagle> {
    enum { value = true }; // or the static const business
};
 
oh I think I'm getting it
 
There are std::true_type and std::false_type in the <type_traits> header of the new standard, which do exactly the same.
 
this seems to work
but is it technically correct?
 
00:00 - 16:0016:00 - 00:00

« first day (315 days earlier)      last day (4634 days later) »