« first day (616 days earlier)      last day (4344 days later) » 

6:00 PM
Or maybe it works, I can't work out the arithmetic. I need cookies.
 
@LucDanton no idea. just wanted to note this about init lists
you will not be able to emplace ofc
 
Well that sucks! Then I still need to write all those overloads for perfect emplacement!
 
but the dilemma is: if you only have the emplace thing, you cannot pass init lists anymore
becuase there is no perfect forwarding for them
IMO ppl should first fix that.
adding a magic language support type making this possible would be great
 
I'm now the proud owner of a pair of Peter Griffin slippers – ugly but snuggly. http://t.co/gAXLy1X3
 
@JohannesSchaublitb What version of emplacing? Via perfect-forwarding constructor or the other I'm trying out right now?
 
6:01 PM
(clearly I’m bored …)
 
@LucDanton what is that other version?
 
optional<T> o = emplace(foo, bar, baz);. Still possible to pass emplace({ foo, bar, baz }, qux); too.
"Explicit request for emplace construction" is the gist of it I think.
 
@LucDanton boost has that by use of boost::inplace_factory
 
@JohannesSchaublitb Aye. A bit of perfect-forwarding sprinkled on top should be nice.
 
@LucDanton how will youi do emplace({ ... }, qux) ?
 
6:05 PM
Also, probably constraints. So that void foo(optional<std::string>); void foo(optional<int>); foo(emplace(42)); is possible.
 
you cannot use std::initializer_list because { ... } can be heterogenous
and there is no type that will allow template argument deduction to deduce the list element types
 
That's specifically for std::initializer_list, e.g. for std::vector<int> which can accept (std::initializer_list<U>, Allocator).
emplace is really meant as a function call, not to mimic initialization.
Which really avoids all the problems that the four overloads needed to avoid when trying to provide perfect perfect-forwarding constructors (narrowing conversions, explicit vs implicit and whatnot).
 
the imperfectness of perfect forwarding makes me laugh and cry simultaneously
 
@LucDanton wow that thread is rather long!
 
@JohannesSchaublitb Ya! It is interesting, but not really going anywhere as to what std::optional should look like.
 
6:13 PM
Hmm. I'm currently listening to some Francis Cabrel. I still don't know why.
 
I don't know either.
 
@EtiennedeMartel Dear lord
 
It's like it's just bearable enough to not bother me, and I'm too lazy to stand up and change the music.
 
A plane just flew over really low. And really really loud.
 
@CatPlusPlus Did you crawl under the table?
 
6:15 PM
@CatPlusPlus Hmm, the Army is onto you. It's about time.
 
@DeadMG The word "perfect" is never really appropriate in the context of C++.
 
Alright, who flagged this?
 
@sbi what's this plonking?
also, i see no flags
 
i flagged it
 
lotsa unknown folks here though
 
6:23 PM
NOT
 
Maybe it's because he's the only one who talks abou parenting, but I read this and thought of @sbi: xojane.com/family-drama/first-time-daughter-i-hate-you
 
sbi
@CheersandhthAlf I think you've been to Usenet before even me, so I am not sure what you expect me to explain to you.
 
i mean, who did you plonk?
i only ever killfiled one person in chat
 
sbi
@CheersandhthAlf That's a reply, Alf.
 
oh, but johannes is very smart
don't let him get to you though :-)
i think i saw a flag there
it just disappeared again?
 
6:27 PM
Yeah, someone's flagging for fun.
 
is it possible to signal like, say, Morse, via flags?
 
It could be anyone. I say we blame @sbi because it's the least likely option.
 
@CheersandhthAlf Stack Exchange is playing games with your mind.
 
why least likely? he's bored out of his mind what with family all around preventing him from working on interesting C# problem.
 
sbi
@EtiennedeMartel Look what this is a reply to.
 
6:29 PM
@sbi Hmmmmm.
 
hm, i should repost leeloo chicken video
 
sbi
@CheersandhthAlf I'm not even replying to that.
 
@sbi fail
 
sbi
6:30 PM
@Cicada refer != reply
 
But she's got a point.
 
@sbi Do play on words
 
This is a reply to an earlier message
 
6:32 PM
WOOT
 
10
Q: Bug: The Woot badge

user130388I just received the Woot badge on SO, neat. But the strange thing is, I only visited the site once when I first noticed the badge. The requirement is to visit the site every day for 30 days, so how come I got the badge? edit: wait, I think I get it. I have to visit SO, not Woot. Right?

Good times…
 
does anyone here know haskell?
 
"If you're skeptical about the idea of confirmation bias, will that skepticism make you more likely to ignore information that provides evidence in favor of that idea?" - Andrew Koenig
 
@AgainstASicilian yeah.
 
sbi
6:34 PM
@CheersandhthAlf When I was teaching students, I saw a lot of young people, some smart, some not so smart, some likable, some not so likable. I always looked for potential coworkers for the company I was working for back then, so I regularly thought "If this person worked for our company, how much would we gain?"
 
But not me.
 
sbi
I've been on the employer's side of the interview table often enough to have an idea what to look for. After several years of doing this I came to the conclusion that I'd rather have a decently smart, but very social competent person than the smartest ass who's severely social handicapped.
 
@sbi I will flag in a few seconds.
lol
 
@JohannesSchaublitb That's gay.
 
Rainbow flagging?
 
6:35 PM
@sbi I +1 that
 
i am trying to understand a snippet of haskell code but cannot translate it to something i understand
 
(How screwed am I?)
 
no. it's not gay. it's a flag
 
no. it's gay. it's a fag
 
@sbi Indeed, I wouldn't want to work with someone I wouldn't want to have a beer with.
 
6:35 PM
lulz
 
sbi
@RadekSlupik I'm not even replying to that.
 
@Cicada I don't think we're that interested in knowing the details of your private life.
 
@sbi Ok.
 
@sbi Meta.
 
@Cicada he he, i don't know what that's supposed to mean coming from a lady
 
6:36 PM
@EtiennedeMartel Ce post devait suivre immédiatement le précédent
 
Stop talking in strange languages. Nederlands is een veel mooiere en duidelijkere taal dan Frans.
 
sbi
@Cicada Did you? I can't see it.
 
@CheersandhthAlf It would have made sense if I hadn't been interrupted by AgainstASicilian
 
@Cicada C'est des choses qui arrivent.
 
6:38 PM
J'ai toujours été impressionnée par le semblant d'aléatoire qu'ont les mots néerlandais. Fascinant.
 
@RadekSlupik My great grand father was Dutch. So I root for them whenever there's a football tournament. Didn't turn out that great recently.
 
I'm great too.
 
@RadekSlupik I basically said "dutch is a horrible language"
And I mean it
 
dutch is awful
 
It's even worse than german
 
6:39 PM
Dutch is beautiful.
 
German sounds angry.
 
AHHH MOTHERLAND
^angrier
 
SCHEIßEEEEEEEHHHHRRRR!!1
 
German sounds angry. Dutch sounds spitty / dribbling / sick.
 
The most beautiful language is C.
 
6:40 PM
Overall unhealthy
 
sbi
@Cicada It's merely a strange German dialect, anyway. :)
 
WOW I earned the [badge:reversal] badge!
 
@JohannesSchaublitb nolifer. :p
 
@Cicada Dutch is a horrible language indeed. A fitting term would be: misbaksel.
 
@JohannesSchaublitb On SO, reversal badge earns you.
 
6:40 PM
20
A: Is std::shared_ptr guaranteed to be initialized to 0 by default?

Johannes Schaub - litbYes, but this should be better explained IMO. The shared_ptr is empty. It's not holding a null pointer. This is an important difference. If you initialize a shared_ptr with a pointer initialized to NULL, then the shared_ptr construction may fail and throw an exception (out of resources exceptio...

 
@StackedCrooked Well, it's better than Flemish.
 
Yeah.
 
(He's good)
 
@JohannesSchaublitb I like how the accepted answer has a score of -4.
 
6:41 PM
HAHA
 
@JohannesSchaublitb note that if you initialize with a nullptr as actual argument, and no deleter, then that is defined as default construction
 
@CheersandhthAlf will it not be a non-empty result state?
 
no
it will be empty
 
oh
i will fix my answer
 
except compilers don't agree, but that's the standard
 
6:44 PM
i will add a footnote
 
i think it is a defect, because 0 is different from nullptr in this context
 
0 is different from nullptr in int n = 0; too.
 
yes but there it isn't mean to be a nullpointer'
 
But I would like to agree with you. I think in the shared_ptr case they should be the same
 
6:45 PM
0
Q: Why source spoofed packets , cant transmitted in internet?

Victor XVi use raw socket to spoof source ip of packets but i cant recieve , spoofed packets in target... if my ip is : 44.44.44.44 i cant recieve packets with source ip : 44.44.44.45

._.
DeadMG makes poor food decisions, Robot makes poor sleeping decisions, I make poor SO decisions.
Why do I look at the question list.
WHYY.
 
@CheersandhthAlf i checked. the spec seems to say it is non-empty afterwards
 
can anyone help me with a snippet? i asked on SO but it was closed for being too specific/not useful to others
 
constexpr shared_ptr(nullptr_t) : shared_ptr() { }
 
^ That's from the class definition.
2.0.7.2.2/1
 
6:48 PM
ohh thanks!
it's even constexpr. didn'T know that
 
i meant §20.7.2.2/1
 
hi
Could I check something:
 
A checkbox.
 
Reminds me of that 4chan thread :)
 
6:50 PM
@KerrekSB yes?
 
Is it true that shared_ptr is supposed to have an atomic compare-and-swap function?
I think I need exactly that for a lockfree queue implementation
 
@CheersandhthAlf oh that'sbad
 
@StackedCrooked Oh how clear. “That 4chan thread” out of the gazillion 4chan threads that have existed.
 
that ctor is not explicit. so void f(shared_ptr<int>); void f(IntWrapperClass); int main() { f(0); } is ambiguous
 
It looks like GCC 4.7 hasn't heard of it, but the standard seems to demand it
 
6:52 PM
there is atomic_exchange
 
@KerrekSB If you know the Standard demands it, what's the question?
 
@LucDanton I wonder if I'm misunderstanding it...
 
or whether there's a deep reason why GCC doesn't implement it
 
sbi
@CheersandhthAlf I consider this one incredibly good.
 
6:53 PM
@sbi I got a 401 on that one.
 
@sbi forbidden
 
sbi
@EtiennedeMartel Does it work now?
 
yes, what did you do?
 
@sbi Yes.
Woooaaa.
 
sbi
@CheersandhthAlf I originally directly linked to the .jpg file. This worked for me, but they must have some measures to prevent that.
 
6:54 PM
@CheersandhthAlf fixed
 
sbi
@EtiennedeMartel Exactly what I thought when i saw it.
 
Anyone has experience with the implementation of delegating constructors of GCC? It seems to instantiate the move constructor.
 
@JohannesSchaublitb i didn't even think of completeness. good point
is NULL guaranteed to be nullptr in C++11?
 
@StackedCrooked I'm not.
 
6:57 PM
@CheersandhthAlf No.
 
When it comes to 4chan, one is never satisfied.
 
I did what I could.
 
@CheersandhthAlf nope
@CheersandhthAlf but NULL is convertible to nullptr_t
 
@StackedCrooked Reminds me of the stupid anti-piracy stuff.
 
so... which conversion takes precedence?
 
6:59 PM
this is ambiguous: void f(shared_ptr<string>); void f(vector<int>); int main() { f({0}); }
 
overload resolution => me dizzy
 
@CheersandhthAlf Catholicism?
 
IMO that's a shame
@CheersandhthAlf note that making the nullptr_t ctor of shared_ptr explicit will not fix it
 
Oh that right. Damn I was talking out of my ass again.
 
oh! javeh!
 
7:00 PM
since this is list-initialization, which does not ignore explicit ctors
 
@JohannesSchaublitb Wait what?
 
I think what's missing in GCC is for shared_ptr<T> to be aligned on a two-word boundary, not one.
 
@JohannesSchaublitb Does that mean explicit affect overload resolution?
 
@LucDanton it does specifically not affect overload resolution if you are doing list-initialization. only in the other cases it will affect overload resolution
case in point: struct A { explicit A(int); }; void f(vector<int>); void f(vector<int>); int main() { f({1}); } <- ambiguous
BUT
 
Outside of list initialization the rules are attempt non-explicit first, then attempt explicit, and error if an explicit constructor is found in a context that doesn't allow it?
 
7:04 PM
case in point: struct A { explicit A(int); }; void f(vector<int>); void f(optional<int>); int main() { f(1); } <- NOT ambiguous
@LucDanton nono. outside of list initialization is: ignore explicit ctors
 
Whoa there what kind of optional<int> is that :(
 
they are never attempted
@LucDanton doesn't matter :)
 
sbi
@RMartinho: Right now it looks you you'll get the Spaniards. :)
 
I think there are some typos in your examples lol.
I still get the point though.
Is foo bar = baz; still tied to some assignment op?
(Assuming there is a relevant constructor.)
 
@LucDanton what do you mean "tied to some assignment op" ?
 
7:13 PM
Requires e.g. accessibility, and requires instantiation for a template?
@JohannesSchaublitb I think you meant to ping Alf. I'm not really involved with that std::nullptr_t constructor.
 
you mean whether F f = 0; requires instantiating the ctor of F?
oh
@CheersandhthAlf ^^
 
Can you overload on literals in C++?
 
@JohannesSchaublitb I'm more curious about the assignment op, GCC doesn't accept optional<nomove> o = emplace(foo); because it instantiates the move constructor.
 
@zounds C++11 allows for user defined literals. If that's what you meant.
 
optional<nomove> o { emplace(foo) }; being fine.
 
7:15 PM
@LucDanton as you know, that will not need operator=
it's copy initialization
 
@EtiennedeMartel I was thinking of overloading a function on string literals, but accepting on const char *
 
I thought as well. GCC not being conformant?
 
erm, not accepting const char *
 
Well, string literals are const char[], so you could write a template function.
 
@LucDanton do you have a testcase?
i have problems understanding your problem description
 
7:19 PM
@JohannesSchaublitb No. I was checking if I would need to produce one. Does that mean I should proceed?
 
i guess yes
 
My problem is that optional<nomove> o = emplace(foo); instantiates the move assignment op for optional<nomove>, which is a failure since nomove is, well, not movable. Time to check if the right constructor is being called.
@JohannesSchaublitb Oh come to think of it, the value in a C++11 version of the Boost inplace-factory is that it's non-intrusive, isn't it?
 
hmm
dunno
the c++98 version was also nonintrusive
 
Mmh, it appears the problem is that I can't read error messages. What is instantiated is the move constructor, not operator. In my defense however both operator= and optional start with op.
 
7:32 PM
I guess it's time to stop coding and kick back for a while.
 
if you live in the northern hemisphere, go eat some ice cream
 
curse you, for I have none.
single malt whisky will have to do as my vice for now
 
What is it with trolls in comments? Do arguing with an accepted answer from an op make them feel better about themselfs?
 
@johnathon Yes, they are neurotic.
 
@LucDanton Is that boost::optional, or your own?
 
7:46 PM
@KerrekSB Mine.
 
@StackedCrooked just had a lengthy discussion that ended up PROVING i was correct about how mingw typedef's types differently than windows sdk does. Im like fuck man read the damn headers.. TWICE!
 
@LucDanton Oh OK. Does boost::optional handle movable-only types, though?
 
No.
That was my initial motivation for rolling up my own optional.
 
@EtiennedeMartel Was fällt Dir ein? Du kriegst gleich eine geklebt ;)
 
@FredOverflow I have no idea what you just said, but I feel threatened.
 
7:56 PM
I think you should be.
 
@DeadMG You should read a book by Scott Meyers. The usually have a perfect forewording ;)
 

« first day (616 days earlier)      last day (4344 days later) »