« first day (836 days earlier)      last day (4111 days later) » 

3:02 PM
Also @Stacked shame on you for no #include <memory> :P
 
Yeah, my mistake.
@R.MartinhoFernandes It doesn't have to be shared_ptr, technically an auto_ptr could be used.
 
user784668
@StackedCrooked Oh fuck. You mentioned it.
 
Xeo
@StackedCrooked WHAT
 
Or a difference type of wrapper. Anyway it must be copied inside the lamda.
 
Well, the problem is tbb queues, not promises nor packaged_task.
 
Xeo
3:03 PM
Aye, they don't support moving. They suck.
 
@Xeo Something like this. (Dunno why it doesn't compile anymore though.)
 
Xeo
@StackedCrooked Because auto_ptr copy ctor takes non-const ref, and bind functor adapts to that.
 
@R.MartinhoFernandes I used a deque (with mutex) in the past. I don't see why it would matter though.
 
Xeo
So there's a mismatch.
 
    std::packaged_task<typename std::result_of<F(T&)>::type()> task {
        [f, this] {
            return f(mObj); // I'm ignoring the cancellation bits for now; easy enough to replace with atomic<bool> or something
        }
    };
    auto result = task.get_future();
    mQueue.push(std::move(task));
    return result;
@StackedCrooked It matters because you cannot put the packaged_task in the queue.
 
Xeo
3:05 PM
(Note: std::packaged_task<R()>::operator() returns void. For the confused here.)
 
@Xeo You mean, en-passant?
 
Xeo
Robot
 
@R.MartinhoFernandes How would move semantics solve this problem?
 
@StackedCrooked It makes my code compile.
 
Xeo
What do you think of a language feature that lets you require the destructor to be called in the same full-expression as a constructor?
 
3:07 PM
@R.MartinhoFernandes But why?
 
@StackedCrooked Because packaged_tasks are move-only (hint: they carry promises).
 
But the problem is that I can't store tasks with different signatures in the same queue. Move semantics won't fix that.
 
3 mins ago, by Xeo
(Note: std::packaged_task<R()>::operator() returns void. For the confused here.)
 
@R.MartinhoFernandes But the signature of the packaged_task object is matters when you need to store it in the queue. Not the signature of operator().
 
Xeo
@StackedCrooked No it doesn't.
 
3:11 PM
Packaged tasks are function objects.
 
std::result_of<F(T&)> - how does it work btw?
 
Xeo
std::function<Sig> is only concerned about the signature of operator().
 
@Abyx decltype.
 
Xeo
@Abyx decltype(declval<F>()(declval<T&>())), basically.
But a bit more complicated because free functions, member functions, stuff.
 
> But I've never seen the Icarus story as a lesson about the limitations of humans. I see it as a lesson about the limitations of wax as an adhesive. The cold of Titan is just engineering problem. With the right refitting, and the right heat sources, a Cessna 172 could fly on Titan—and so could we xkcd what-if
 
user784668
3:13 PM
SO chat oneboxes what-if links?
 
@Fanael lol no.
 
user784668
@ScottW Where?
 
new what-if? thanks god I was going to work
 
user784668
@R.MartinhoFernandes So "it oneboxes everything except TVTropes" is a lie :(
 
user784668
@BartekBanachewicz Tuesday's today's day of the day.
 
3:15 PM
@Fanael huh :)
 
@Xeo Are you saying that this should work?
 
std::function
 
So, I ordered Hyrule Historia.
 
@R.MartinhoFernandes You mean I should use std::deque<std::function<void()>?
 
user784668
@ScottW oh lol
 
meh... g++ sucks. I get a compiler error - stacked-crooked.com/view?id=0559cb3eaf673b10454e822e877e7c27
 
@StackedCrooked Yes. If you don't want the extra type erasure hit, write a packaged_task variant (it's very simple).
 
Wow. X-Plane really means it when they say it's the most realistic one.
> On Earth, users can land at any of over 33,000 airports or test their mettle on aircraft carriers, oil rigs, frigates (which pitch and roll with the waves), or helipads atop buildings.
 
@StackedCrooked I don't know where that copy comes from.
 
I want to try it.
 
user784668
 
@ScottW Nothing new:
Sep 18 '12 at 11:55, by sehe
@R.MartinhoFernandes Regarding singletons. I found this in our framework code today: http://ideone.com/3NylI
 
@BartekBanachewicz it's over 9000 GB
 
@melak47 well there's a demo, I doubt it has full world
 
user784668
@BartekBanachewicz It's used to test the designs of actual planes.
 
@ScottW I cried a little
 
3:22 PM
@Fanael and to fly on your iPad
 
@StackedCrooked The fuck. (@Xeo?)
 
@BartekBanachewicz Realism
 
user784668
@sehe Java in C#.
 
@R.MartinhoFernandes Perhaps for similar reasons as to why this doesn't compile?
 
@sehe you knew perfectly well what I meant
 
user784668
3:23 PM
@ScottW That's what I said.
 
1 hour ago, by R. Martinho Fernandes
@BartekBanachewicz No one cares if you don't understand what everyone else does.
 
Even emplace_back makes a copy there.
@StackedCrooked No, that one is not movable. stacked-crooked.com/view?id=3203ab21565b6666370f9b1ca8d601ab
 
@R.MartinhoFernandes Yep, @Xeo explained that one earlier to me.
 
user784668
@BartekBanachewicz I don't have an iPad, so, no.
 
@ScottW Caaaaaaaaffffffffffffeeeeeeeeeeeeeeine!
 
3:25 PM
@Fanael you should get one then
 
@BartekBanachewicz Why would he do that? iPads suck!
 
@StackedCrooked It's std::function that makes the copy somewhere...
 
user784668
@JerryCoffin Not sure if serious, but yeah, this.
 
@JerryCoffin my iPad is the greatest piece of electronic device I've ever had contact with
 
user784668
@JerryCoffin Coooooooffffffffffffffffffffffffffffffffiiiiiiiiiiin!
 
3:26 PM
Deathly
 
Lethal dose
 
user784668
@BartekBanachewicz Says a lot about the pieces of shit^H^H^H^Helectronic devices you've had contact with.
 
@R.MartinhoFernandes I finally understand now. std::function wraps the packaged_task and provides type erasure.
 
Cocaine (benzoylmethylecgonine) (INN) is a crystalline tropane alkaloid that is obtained from the leaves of the coca plant. The name comes from "coca" and the alkaloid suffix -ine, forming cocaine. It is a stimulant, an appetite suppressant, and a topical anesthetic. Biologically, cocaine acts as a serotonin–norepinephrine–dopamine reuptake inhibitor, also known as a triple reuptake inhibitor (TRI). It is addictive because of its effect on the mesolimbic reward pathway. Unlike most molecules, cocaine has pockets with both high hydrophilic and lipophilic efficiency, violating the rule o...
 
3:27 PM
@StackedCrooked Yeah, but something's wrong with std::function here. It insists on copying shit.
 
@Fanael Yea, that says a lot about pretty much every high-end Samsung and HTC phone or tablet.
 
@Fanael Yes, I'm quite serious. I got my wife one for Christmas. Most complete waste of money of my entire life.
 
Nice, Arch got permission to distribute Steam from the repos.
 
@ScottW It's not really the same.
 
@JerryCoffin That's interesting. Can you elaborate a bit on this? (I'm really curious)
 
3:29 PM
@JerryCoffin Really?
 
user784668
@R.MartinhoFernandes So we can expect Steam to land in [community] soon?
 
@Fanael I'd say so.
 
@EtiennedeMartel That like using a sledge hammer to push down a punaise.
 
> In fact, humans on Titan could fly by muscle power. <3
 
@StackedCrooked This would be another option if you are worried about the double type erasure (from packaged_task and then function): stacked-crooked.com/view?id=a8fc533f4dc607e6165480dd9e1bc439 It's basically a packaged_task without the type erasure and a bit specialised :)
 
Xeo
3:32 PM
@R.MartinhoFernandes I have no fucking clue.
 
@R.MartinhoFernandes The reason why I couldn't get it to work with packaged_task is because I didn't realize that. I tried use queue<packaged_task<...>>
 
user784668
@R.MartinhoFernandes Also citation?
 
@Fanael It's in the [arch-dev-public] list.
:7432056 ?
 
Xeo
Nvm, still doesn't make sense.
 
user784668
@R.MartinhoFernandes gtmanfred is a liar
 
Xeo
3:34 PM
> 5, 10) Move the Callable object f into *this.
It should work.
 
@ScottW Coca-Cola stands for Coca (from the coca plant) and Cola (from the kola nut).
 
@BartekBanachewicz Sure. No keyboard, so anything involving significant input is immediately ruled out. To keep with the "slick" image, they use a shiny, extremely glare-prone screen, so anything involving significant output is ruled out as well. Bottom line: sole use is to impress people stupid enough to be impressed by an Apple logo.
 
@Xeo So bug? It bothers me that no one ever ran into it. It's kind of too obvious.
 
Xeo
@R.MartinhoFernandes: I think I got it. The move ctor has no noexcept specification. :(
 
@Xeo Deja vu :)
 
Xeo
3:36 PM
Although I don't know if it's actually implicitly declared and defined.
 
@Xeo The one in packaged_task? Or the lambda? Or what?
 
@Xeo The error is in ctoring the function.
 
user142019
Ohio.
 
Xeo
@R.MartinhoFernandes Oh.
Wat.
 
I hate the Insert key.
 
Xeo
But if it's a bug, libc++ has it too.
 
user142019
Remove it.
 
But packaged_task suffers from the same.
 
@JerryCoffin iPad is meant mostly for information consumption, so I dunno why you assumed that inputting a lot of (text) information should be easy. The glare screen is similar to pretty much every phone or tablet screen, so I don't know why this was a disappointment either. However, it's colours quality is great, and it has really deep black, thus a high contrast, which for me still makes it readable outside.
 
3:37 PM
@Xeo No, it's what you mentioned, but in packaged_task.
This must be fixed. It's a serious defect.
 
Xeo
@R.MartinhoFernandes Non-noexcept move ctor shouldn't affect non-container moves.
 
user784668
@Zoidberg Kentucky.
 
Maybe it's just not living up to some imagined expectations, rather than looking at the device from the point of it's actual purpose and use cases.
 
NO, wait, packaged_task's move is noexcept.
cppreference has bad noexcept UX.
 
3:39 PM
agree
 
Xeo
@R.MartinhoFernandes Yeah, that too.
 
user142019
I should have a test right now.
 
So there's no reason for the function ctor to fail.
 
Xeo
So, back to why function(F f) copies.
 
@BartekBanachewicz I didn't expect decent input -- but for things like watching movies, it's utterly useless as well. I guess the color isn't quite as bad is some laptops, but that's definitely in the "damning with faint praise" category. It's still far short of the monitor I'm using right now, for an obvious example.
 
Xeo
3:40 PM
> note: in instantiation of function template specialization std::__1::__libcpp_compressed_pair_imp
Is what libc++ fails at.
 
libstdc++ fails in the _Function_base thingy.
 
user142019
Today I'll be on Minecraft again.
 
user142019
No more school shit.
 
@JerryCoffin I consider it superior to my IPS displays, which are about $300 dollar each. How expensive is your screen? Also, the resolution is also something that is noticeable for me.
 
user784668
@Xeo __1. They ran out of almost readable names or something?
 
3:41 PM
I think I have used std::function for "move-capturing" before. Wouldn't that trigger the same thing?
 
Xeo
@Fanael inline namespace __1.
 
@Fanael It's like detail, but short and easier to ignore.
 
Xeo
versioning and shit
 
user784668
@R.MartinhoFernandes Ah.
 
Xeo
@R.MartinhoFernandes Not quite, though. It's not really a detail namespace.
Everything in libc++ (except exceptions and initializer list, I think) is versioned in an inline namespace.
 
user784668
@Xeo Versioned?
 
Xeo
@Fanael Yes. If they bump to a new version (__2), linking with old binaries will fail.
 
@BartekBanachewicz It's a LaCie 321. I believe it was around $1000, but that was something like 8 or 9 years ago, if memory serves.
 
user784668
@Xeo Ah. So you mean they haven't heard of file names.
 
@R.MartinhoFernandes same thing happens in VC++
 
Xeo
3:45 PM
@Fanael Eh.
 
Someone wants to open a question on SO to ask if it's expected?
I need to leave for class soon, otherwise I would do it.
 
Xeo
@Fanael The standard header names are fixed by the standard, y'know?
@R.MartinhoFernandes I'll do it.
 
@R.MartinhoFernandes German class?
 
Maybe check bug trackers too :)
@melak47 Yes.
 
@JerryCoffin well, that's two times the price of an iPad. I know you should compare to the best possible, but ignoring the price doesn't really make sense for me. It's definitely the best mobile screen on the market right now, confirmed by proffesional testing.
 
Xeo
3:46 PM
I'll recheck the ctor with the standard, though.
 
@R.MartinhoFernandes Viel Spaß :)
 
Hey, that's my line!
 
user784668
@Xeo The standard library library file name is not fixed by the standard, y'know?
 
user784668
@Xeo Oh wait.
 
So maybe, again, the expectations were a bit unrealistic
 
user784668
3:47 PM
@Xeo There's also the name mangling thing. And related ABI stuff.
 
user784668
@Xeo I get it now.
 
Xeo
@Fanael Yeah, name-mangling is why the versioning will make linking to old binaries fail.
 
user784668
@Xeo I was thinking about shared libraries originally, so a soname bump would do the trick, but I completely ignored the existence of static libraries and stale object files.
 
@BartekBanachewicz Yes, but look at the age. Even dirt cheap LCDs were $500 or so at the time. Obviously the "professional testing" isn't taking the glare problem into account. Those that attempt to compete with it may be even worse, but that doesn't change the fact that it's a piece of shit. High resolution is little use when you can barely see anything through the glare.
 
Xeo
@R.MartinhoFernandes What really bugs me is std::function's move ctor not being noexcept, though.
 
3:50 PM
No wait, that wouldn't be a problem.
 
user784668
@JerryCoffin It's a l'Cie?
 
@Xeo It can only be noexcept move if the underlying type is noexcept move, which it can't know.
 
@Fanael Don't you dare talk about FFXIII.
 
@Xeo It's runtime noexcept.
 
although I don't understand why std::function was not defined to be shared.
 
3:51 PM
@Fanael LaCie‌​.
 
Xeo
> Effects: If !f, *this has no target; otherwise, move-constructs the target of f into the target of *this, leaving f in a valid state with an unspecified value.
@R.MartinhoFernandes No mentioning of any throw at all.
 
@Xeo Because that can only be determined at runtime.
 
@JerryCoffin It's like complaining all the cell phones and tablets are shit, because they have limited battery life and thus you can't use them forever without charging. I don't really have such problems with the glare, and I use it quite often outside. Indoor usage if of course totally different matter, which you seem to ignore.
 
@Xeo Type erasure erases the noexceptness of the ctor.
 
@BartekBanachewicz I'm talking about indoor use. I've never even tried to use it outdoors.
 
Xeo
3:53 PM
True. Still bugs me.
 
user784668
@JerryCoffin I have no problems with the power supply, thank you. Anyway @EtiennedeMartel got it.
 
Xeo
> Requires: F shall be CopyConstructible.
 
That's irrelevant.
 
Xeo
> Otherwise, *this targets a copy of f initialized with std::move(f).
This sounds so weird.
 
well, VC++ just sucks.
	template<class _Fx>
		function(const _Fx& _Func)
		{	// construct wrapper holding copy of _Func
		this->_Reset(_Func);
		}
 
3:54 PM
@JerryCoffin Wat? Are you implying that you are experiencing glare problems indoors? That's quite unheard of, really.
 
Xeo
:7432333 Other way around?
 
user784668
@Abyx All compilers do.
 
@Abyx No _Fx&& ctor?
 
@R.MartinhoFernandes yep
 
Xeo
	template<class _Fx>
		function(_Fx _Func _NOT_INTEGRAL(_Fx))
		{	// construct wrapper holding copy of _Func
		this->_Reset(_Func);
		}
@Abyx You suck.
 
3:56 PM
@BartekBanachewicz I'm not implying at all -- I've stated it quite directly, repeatedly. I don't think it's unheard of at all -- every time I see somebody at Starbucks (etc.) using one, they're pretty much constantly moving/shifting it around, in an apparent attempt at finding a position where they can even read what's on the screen. I think most have gotten so accustomed to constant glare, they don't even notice they're doing it.
 
@Xeo Forcing noexceptness could be done only if you gave it reference semantics.
 
I.e. no SBO.
 
Small Book Optimization
 
Xeo
VC still sucks, though, since it's _Reset(_Func), not _Reset(std::move(_Func)).
Can't check right now for VC11
 
3:58 PM
STO, 'thingy'.
 
@JerryCoffin Well, that might be the case with me. I don't really experience it as a problem, though; your case might just be special. It's interesting how people can experience the same thing differently. Thanks for your explanations.
 
@Xeo is it from VC++10 ?
 
@Xeo haha, maybe it actually moves because of old rules?
 
Xeo
@Abyx Aye
@R.MartinhoFernandes Err... no.
 
Then it just sucks.
Isn't STL the maintainer of that thing?
 
Xeo
3:59 PM
Aye
 
user784668
@R.MartinhoFernandes He is.
 
Are you sure it's not all one big ass lie?
 
well... we can write our own type-erased callable.
 

« first day (836 days earlier)      last day (4111 days later) »