« first day (1701 days earlier)      last day (3265 days later) » 

9:00 AM
@LucDanton The point is, my proposal works as long as the covariant accessors return references to the same object. I doubt your accessors don't fit the pattern, but a counterexample would be very interesting.
 
I just gave you one. Namely the pair and tuple types of the Standard library ._.
the most exotic of types
They’re not 'my' accessors really
 
@LucDanton export(&&) is only for member accessors. For non-members, you would just declare the parameter as a forwarding reference, mark it as export, and then you're done.
 
@Potatoswatter Humour me and pretend there are member versions of get then. As old Boost.Tuple did.
Why are you sidestepping me? Do you consider my arguments to be a waste of your time? I can stop if you want.
 
@LucDanton Then, t.get<N>() is going to refer to the same object whether t is const or an rvalue or whatever. So the pattern applies.
@LucDanton ? No, this is valuable. This proposal hasn't yet had much constructive review at all.
 
auto p = make_unique<int>(0); auto x = tie(p); { auto&& y = std::move(x).get<0>(); } assert( p );
Does the assert fire?
 
9:05 AM
No, because get returns by reference, not value. So?
 
But… don’t they all do?
16 mins ago, by Potatoswatter
@Puppy Because export(&&) works by transforming & into && and adding move. It's a kind of covariance.
You said it yourself?
@Potatoswatter I would need a prvalue for my example to make sense is that right?
That is, tie(x).get<0>()?
 
Not seeing your point. It turns an lvalue reference into an rvalue reference, not into a return by value.
@LucDanton There's no prvalue there either. Er, only the tuple which contains references. Not sure what you're getting at.
 
@Potatoswatter tie(x) is a prvalue of type std::tuple<…>
I’m suspecting I can’t make the assert fire (easily), which is nice. But it’s still the wrong return type. I’ll write a more fleshed out example.
 
@LucDanton Ah, I see now. If the accessor might represent either owning or non-owning semantics, then indeed the covariance does not apply.
 
That’s what I meant by 'a handful of class writers'.
If it’s worth writing an overloaded accessor, then I don’t see how it will fit the rules.
 
9:12 AM
I think this is fixable. Such an accessor has to use reference collapsing in its return type. tuple_element is going to return foo & and then the return type is foo & &&. I just have to say that export(&&) applies to the declaration, before reference collapsing applies.
There might not be any uniform function declaration that handles these cases, though.
However, I think most programmers are writing things like Container::front and Container::back, not things like boost::tuple::get.
 
I was considering the 'move the returned value' actually.
Even before that I normally do not return T&&, so it’s already too late. Older versions of experimental::optional<T> had a T operator*() &&;, too, but that’s changed.
 
Finally some diversity
>
i’m naughty and willing to please…

I’m up for anything… My username is CurvyMistress38
 
@Potatoswatter There’s literally no difference, other than the typical allocator/container combo does not treat reference value types.
 
@LucDanton Reference types are the difference, that's all.
 
I.e. hand out a reference to some of the contents, which might happen to be a reference. It’s almost the same rules as with struct foo { bar& thing; };.
 
9:16 AM
@LucDanton Yes, a "pointer-like class" as I mentioned earlier.
 
Oh I thought that was like smart pointers etc.
 
@LucDanton They count too.
 
They’re the dumb kind of smart pointers.
Too many exceptions, too many rules, too much things to learn. And I get nothing in return.
 
You've mentioned one exception: classes which treat references and non-references generically. I don't think most folks write those.
 
@Potatoswatter I thought you enlarged that to any 'pointer-like class' (btw obv. a reference type is not a class type)? Were you referring to the possible fix only?
 
9:21 AM
@LucDanton A pointer-like class propagates lifetime extension to its referent. But it's considered as an ordinary class in itself.
@LucDanton classes which treat (references and non-references) generically
 
paaaaarts
computer paaaaarts
 
To reiterate two exceptions/situations were mentioned: a non-reference return type on the one-hand; and whether it’s possible to have a more involved set of overloaded bodies than lval/move(lval).
 
@Puppy new GPU? :)
 
it's due to arrive in about five minutes
 
By the way, smart pointers like unique_ptr aren't interesting in the first place since the referent can't be a prvalue…
 
9:23 AM
@Puppy tell me you didn't choose amd :(
 
@Puppy Ah, the joy of anticipation...
 
Those two things happen to coincide in a tuple of references, but they can evolve independently. E.g. I do 'access' from foo<T> to bar<U> on occasion, where U is T qual depending on the selected overload.
@Potatoswatter What?
 
spamming refresh on parcel tracking website
 
Don't hit F5 too often, your keyboard may get into a race condition and produce 5 Fs instead.
 
@LucDanton The immediate referent of unique_ptr won't get lifetime extension because it's on the heap. Only prvalue subexpressions of e.g. a make_unique call could get extension.
 
9:25 AM
@Potatoswatter Is std::tuple pointer-like?
@Potatoswatter Then use optional as an example? Why does unique_ptr matter?
 
@LucDanton If you give it a reference type, yes.
@LucDanton It doesn't. I'm just saying because you mentioned it.
 
No, I used tuple.
unique_ptr was to keep track of moves
 
We're considering a bunch of cases. Never mind.
 
@Potatoswatter See, that’s a lot of additional rules for me.
 
9:28 AM
@LucDanton I think I need a more concrete example.
 
I’ll have a look into my repos.
 
@LucDanton I'm still not seeing the rule. You take the existing code, slap on export because it potentially returns something inside a parameter, done. The export(&&) part is gravy; I never considered its interaction with reference collapsing.
 
Because I’ll have to read someone else code some day and understand what it is that they are trying to do.
bad typo
 
Already such a class needs to break out the reference and non-reference cases. std::get(tuple) adds cv-qualification and reference type if tuple_element returns an object type, otherwise it doesn't.
Your complaint is only that I folded 4 annoying overloads into 1 declaration, but there still might be additional cases.
 
@Potatoswatter That’s not true.
@Potatoswatter No. My complaint is that it’s a lot of additional mental overhead, and I don’t think the benefits are worth it.
 
9:37 AM
@LucDanton Hmm, it adds reference type regardless and turns an rvalue into an lvalue. I don't think that's kosher.
 
Most new proposals (i.e. short of a proposal to just remove stuff) involve learning new rules etc. and I always have to ponder if it’s worth the bother.
 
Is it worth the brother?
 
@Potatoswatter tuple<T...> is almost but not quite like an on-the-fly struct stuff { T members...; }; although of course you can’t declare a member pack like that.
 
@LucDanton The alternative is combinatorial explosion. Do you support const &&? Do you support volatile? That's mental effort too, and typing effort.
@LucDanton Access to a nonstatic member reference does not work like get.
 
So yes, admittedly by covering a tuple<T...> generically for an arbitrary T... (provided that they would be legal members) is a high standard, since you cover almost any possible struct definition. But OTOH being generic is it’s own reward: eliminate exceptions, irregularities, etc.
@Potatoswatter Yeah there’s a difference which escapes me. I’ve never figured out which way is preferable to the other, too.
@Potatoswatter That’s not how I do generic programming. I don’t start by supporting this-and-that and then start adding things and rules.
Jun 8 at 21:58, by Luc Danton
@CatPlusPlus Generic programming doesn’t seem to interest a lot of people anymore.
I’ve been feeling I’m in the minority these days though.
Kind of a shame since I got into it after reading Alexandrescu, Meyers etc.
 
9:42 AM
@LucDanton So… what do you do? We're forced into this-and-that by the lack of generic facilities for forwarding value category and cv-qualification from this, which is exactly what I'm trying to address…
 
@LucDanton Really?
 
(Avoiding member accessors is the obvious answer I suppose, but that's a non-starter for many. Blame Java.)
 
@Potatoswatter If I overload on &, const& and && then the return types involve Item [const]& and Item; the expressions involve item and std::forward<Item>(item).
@buttifulbuttefly Or maybe I really, really miss Abrahams :) I really liked his perspectives.
When I mentioned the Bar<U> thing is that e.g. maybe I return a tuple<ItemA, ItemB> from { forward(item_a), forward(item_b) } (nevermind the tuple constructors) for the && overload.
 
@LucDanton You can't forward from this… I think you're only talking about non-members.
 
Internally I may use ItemA&& instead of ItemA for rvalue-this but I avoid it on the public interface precisely to prevent dangling references.
@Potatoswatter What does that mean?
we mentioned examples earlier; I found this:
index_proxy<Key> operator[](Key&& key) const;
Obviously the return value involve the parameter, not something inside *this (conceptually or actually) though.
 
9:49 AM
@LucDanton export(const &&) is a shortcut to get a bunch of member accessor overloads. Nothing more. So the first two cases are covered and the third doesn't exist.
 
@Potatoswatter Third being the && overload?
 
@LucDanton Right. I mean, you would use move for that overload not forward, right?
 
No, forward. Just like std::tuple, std::pair.
 
Sorry, I haven't really written anything like that, at least for a return value.
(pair doesn't even have accessors, it's just a bare struct.)
 
E.g. you’d write second_type[&&] second() && { return std::forward<second_type>(second); } for a pair.
The [&&] depending on how dangerous you feel vis-à-vis lifetime extension obviously :)
 
9:52 AM
@LucDanton The official direction of the standard library is to live dangerously. That's a big part of how I got sucked into all this.
 
@Potatoswatter If you return std::move(second);, then std::tie(x, y).second() pilfers y.
@Potatoswatter I feel that the SL is very tame actually.
 
Originally, I tried to argue with Ville that correctness trumps performance, so return by value is better.
 
It’s good it’s like that.
 
It's tame so far, but the plan for value category propagation is to return by rvalue reference everywhere.
 
There’s probably no good default for 'dumb' accessors in the SL. I wouldn’t want to spend time bickering on this (e.g. no complaint on my part for the change to optional, at least it’s consistent now).
@Potatoswatter What plan is that?
 
9:54 AM
@LucDanton Just Ville's opinion.
I don't know offhand how much of the committee feels that way, but it seems established that rvalue-qualified accessors will be added, and will return by reference not value.
 
@Potatoswatter But yeah personally I really try to avoid returning &&. I do use it internally (because sometimes I may fetch such a reference several times without pilfering), but I will strive to make a pit of success out of the interface. In a sense, this is why the SL can’t afford to be safe: what if someone uses std::tuple internally?
Not presenting && is also what I will advocate to anyone.
 
(The status quo, that they return by lvalue reference, isn't particularly safe. It just prevents lifetime extension as long as there's no const.)
 
aaaargh
 
@LucDanton For correct, conservative usage of move, you still can't go wrong with return by value.
 
fucking moron tried to deliver my parts to the wrong address.
then left a calling card at the wrong address and drove away without attempting to contact me.
 
9:58 AM
"They'll" point you at errors but they all involve moving twice or using after the move, via aliasing or whatever.
 
no parts.
 
@LucDanton Well, so now my mission is to make it safe to return rvalue references.
 
generic tuples, or why forward
@Potatoswatter That’s not how I perceive it. move/forward serve the need of return by value (from an rvalue), not the other way around.
@Potatoswatter I don’t have a problem with the status quo.
 
@jalf if you're here any time soon (and you got the ping) I have a unicode question I could really use some help with.
lol @ all the "fuck"s
 
Returning a safe rvalue reference instead of a safe value doesn’t seem like an obvious benefit to me.
 
10:04 AM
I don't want a SL that returns unsafe references. Returning safe values has already been excluded AFAICT.
 
user1804599
I don't want a steam locomotive either.
 
@Potatoswatter Right, the difference is that rvalue references are re-forwarded as xvalues for an rvalue tuple. Which is convenient (and entirely logical) when e.g. a tuple of values stand for a 'perfectly-saved' pack of arguments to feed to a functor. But is still different from what a struct would behave. How structs behave here is not entirely without reproach or merit, so there’s no way to win.
E.g. it makes foo(forward_as_tuple(pack...)...) the same as foo(pack...) if you could expand tuples.
 
@LucDanton I might be proposing to change the behavior of structs. The value category of an access to member rvalue reference from an rvalue struct is an lvalue. This was apparently contentious in 2011 and the majority opinion might have changed.
 
@MartinJames wow, what did I just see?
 
10:08 AM
I’m not surprised it was contentious then. The current behaviour stands out (it’s worth a least a quizzical eyebrow), but if you reflect on it the least that can be said is that it’s consistent. So it was clearly the conservative choice, which is how the Committee compromises :Þ
 
@TonyTheLion I think it's a manually-unrolled loop?
 
@MartinJames It something that hurt my eyes
 
@LucDanton Thanks for all the feedback… I'll have to think deeper and see what I can do. Gotta go for now!
 
All this because reference types have a double role of thin aliases that don’t really exist; and that of kinda sorta non-null pointers :(
Don’t skimp on type and compiler theory kids, or else you might end up with a programming language on your hands.
 
user1804599
Fuck EINTR.
 
10:20 AM
@rightfold What? Your doorbell rang?
 
user1804599
The default should've been to automatically retry on interruption.
 
10:38 AM
EINTR is a very dumb thing
 
Is
Base base. (&base)->vfoo();
subject to a virtual call according to the standard?
no optimizations considered
 
Ell
No
 
what exactly are you asking
 
Ell
Oh wait
Yes
 
it's going to call the vfoo function of Base.
there's no polymorphism here
 
Ell
10:47 AM
If it has virtual functions that is
Do you need references for polymorphism?
 
What I mean is does the standard mandate that the dynamic type of the object expression will have to be considered (eg vtable lookup) or is this an obvious call to Base::vfoo ?
 
user1804599
No.
 
user1804599
void f(int);
void f(std::string);
 
user1804599
There, polymorphism without references.
 
I have to say that the comma operator has a very counter-intuitive way of working coliru.stacked-crooked.com/a/91d65438bbfef871
 
10:56 AM
That's not a response to you
 
Xeo
@MarcoA. not really?
It evaluates left-to-right, the most intuitive thing.
 
user1804599
meh comma operator
 
@Xeo the parenthesis might mistakenly make you think what's inside is executed first, but then the left-to-right for the outer comma wouldn't be met
 
coma operator
 
10:58 AM
It's parentheses that are not intuitive then
 
yes, I believe robot is correct
 
(Arguably, it's you that have a misleading intuition about parentheses)
 
++(yes, I believe robot is correct)
and notice the comma operator
 
They just structure expressions; they don't affect order of evaluation.
 
@R.MartinhoFernandes yeah but you know.. I'm still a bit spoiled from the secondary school expressions
were you also used to the precedence order () > [] > {} ?
by that I mean curly braces have less precedence than square brackets and square brackets less precedence than parenthesis?
I suppose that is a mathematical convention
 
11:16 AM
is that a thing?
I thought they had the same precedence
 
Yes, but precedence and evaluation order are not the same.
What establishes evaluation order is the fact that to evaluate a + expression you need to evaluate the operands first.
 
@R.MartinhoFernandes Evaluating (fun(2), fun(3)) before fun(1) achieves that, too.
 
Xeo
@LucDanton And that's where the comma operator's LTR eval comes into play
 
@Xeo Is that the least confusing way to explain things? Did you put a comma operator between the two bits of explanation? :)
 
11:34 AM
@rightfold the serialization equality is much faster than I expected
 
@JohanLarsson she didn't happen to load it upside down, did she?
 
@chmod711telkitty dunno
 
this is another counter-intuitive case: let's have a quiz
try to guess without the help of the compiler
then verify it
 
unit test caught a dumb, yay
 
12:07 PM
anyone here want to do some thru hiking with me?
 
Ell
@MarcoA. that is interesting
I got the first right and second wrong
 
12:48 PM
@Ell I wouldn'T have thought the second would compile.
 
o man does it feel good to sleep properly again
 
1:29 PM
optical illusion
 
^ At least 2
 
Ell
3
 
also this:
 
std::while
 
1:41 PM
how should I create a tag for fold expressions?
 
std::experimental::y_are_we_doing_this::if
 
or singular?
 
Xeo
plural
 
shrug
sure this doesn't apply?
 
Xeo
1:46 PM
Yes, because it's a special C++ language feature
 
@rightfold it seems static if was proposed but was rejected
 
user1804599
Good.
 
user1804599
Don't add anything new to C++.
 
Why, C++ is version controlled. You can go back to any old version you like :v
 
Xeo
@AlexM. There's a new, very restricted proposal for static if
 
1:49 PM
restricted as in area 51 restricted?
 
Xeo
I think that one was rather well received, but not yet ready.
@AlexM. As in, functionality-wise
 
I see
 
Xeo
It gets its own scope, non-dependent stuff in both branches needs to be well-formed, etc
basically all the stuff that was critiqued with the old static if
 
@rightfold so I shouldn't create any new tag?
 
the syntax isn't literally going to be static if (cond) though, right? that'd be weird...
 
1:52 PM
none of those seem to apply for folding expressions
I mean and
 
@melak47 as long as cond is something evaluable at compile time... why not?
 
map reduce explained - thx Dave Chapell http://t.co/05FUyJBL3w
 
@AlexM. I mean the floating static
why not static const if = cond :p
 
right, static_if is probably more appropriate
just wait guys, in a few years we'll have compile time multithreading and binding to DirectX
games will run at compile time
 
Xeo
@melak47 why not?
 
1:55 PM
you know what I want
pizza
brb getting $$
 
user1804599
@Jefffrey :)
 
user1804599
Can a temporary file be a Unix domain socket?
 
@Cubbi Oh, cool, that's good to hear :)
 
@Xeo well, I think it'd look weird.
 
Xeo
@AndyProwl That video certainly has taken off, eh? 36k
 
2:01 PM
@Xeo Yeah, I was surprised
 
Xeo
Damn I'm hungry. Haven't eaten anything yet, today.
 
Neither did I
 
Xeo
I'm thinking of making something, but OTOH I'm also eating out in about 2 hours.
 
Did you guys hear about those guys that targeted the Dallas police HQ?
 
@Xeo Apfel
 
Xeo
2:07 PM
None here :(
 
That sounds like a suicide plan. And apparently they cornered them now, and a sniper shot one of the targets.
 
@rightfold what would be special about it being "temporary"?
 
@Jefffrey lunkplx
 
solution of the quiz, kudos to the ones who got it immediately
please point out mistakes / imprecisions, as usual
 
Ell
2:08 PM
Hmm
Killing nests in factorio is way too easy
I should be working
I'll do that isntead
 
@MarcoA. misleading question. I +1ed because it might help others understand
 
@sehe thanks, I posted it since I got it wrong the first time as well
if that can spare someone my same 2-minutes-figuring-out-why work, that would be great
 
I suppose the whole idea of fold expressions would be to say std::cout << ... << args in the first place
 
user1804599
Awesome. :)
 
@sehe Well… it doesn’t really work for std::cin does it? :D
 
2:21 PM
it also doesn't work for void
I'm not sure what the point is :)
 
user1804599
I really hope fold expressions won't make it to C++17.
 
@sehe I made a funny
 
user1804599
Focus should be on important stuff instead.
 
like parallel algorithms
 
@LucDanton Funny for you maybe :P
 
2:23 PM
@LucDanton You cute little bastard :)
 
I liked the parallel algo stuff
 
I’ll take cute.
 
exec_policy = seq;
if (stuff to work with > treshold)
{
	exec_policy = parallel;
}
sort(exec_policy, collection);
sth like that
 
> Looks like Windows errors are only reported in visual dialog boxes, never on the terminal itself qft
 
user1804599
map[string]chan<- []byte
 
2:26 PM
They all go to EventLog too
 
user1804599
@sehe QFT is an algorithm used in Shor's algorithm.
 
@CatPlusPlus enough truth to be quotable. But yeah I almost commented that.
@rightfold map[4]chan <- u8"I don't even"
 
@sehe I wanted to see what happens but Clang is fussy about >> specifically. E.g. && 'works'.
 
hey that’s cheating! :)
 
2:35 PM
So OS failed during hibernation and this is the cause
DRIVER_POWER_STATE_FAILURE (9f)
A driver has failed to complete a power IRP within a specific time.
Arguments:
Arg1: 0000000000000003, A device object has been blocking an Irp for too long a time
Arg2: ffffe001c1f1f380, Physical Device Object of the stack
Arg3: fffff8028f031960, nt!TRIAGE_9F_POWER on Win7 and higher, otherwise the Functional Device Object of the stack
Arg4: ffffe001c9520750, The blocked IRP

FAULTING_MODULE: fffff800c0e5a000 VBoxNetAdp
I don't know who writes drivers for VBox
But they really really really should not
What an unreliable piece of shit
 
VirtualBox possibly has the worst build system I have ever seen
or at least it used to have (hopefully they changed it)
it was an incredible amount of kludged scripts in various flavors (i.e. python, windows batch files, linux shell scripts, some vb scripts) and hacks to generate tables and stuff (nothing like LLVM) that had to be hacked here and there to get the entire program compiling
the sources were kind of scary too
 
I've seen worse
Try to get a broken autotools build to work
But their drivers are really the worst of all virtualisation software
Some of them are/were literally marked as crap in Linux kernel
Shared folders filesystem is a joke that has no I/O performance whatsoever
Like it's faster to go with a networked filesystem than with that
Which is mindboggling
 
user1804599
WTF Go
 
user1804599
Oh nevermind, I labeled my statement wrong.
 
2:51 PM
waiting for pizza
so painful
 

« first day (1701 days earlier)      last day (3265 days later) »