« first day (1294 days earlier)      last day (3672 days later) » 

user1804599
12:00 PM
 
user1804599
in Java Sucks, 2 days ago, by Moynul
Hello, do you guys hate Java?
 
user1804599
Thanks, Captain Obvious.
 
@rightfold pahaha
 
user1804599
People occasionally ask Java questions in that room.
 
12:06 PM
@MartinJames woof woof?
 
@rightfold Slightly disappointed the theme song never kicked in, though...
 
@LightnessRacesinOrbit I chatted to him earlier so I figure he probably means his actual dog.
 
user1804599
Dunno. Never played that video game.
 
@LightnessRacesinOrbit, well I mean my implementation of my dynamic Box arrays is not correct, but it doesn't mean that dynamic array won't work. — Daniel 44 secs ago
o.O
 
12:07 PM
this is Daisy helping my mother browse the Internet
 
@DeadMG Yeah sure that or he's drunk again
 
@DeadMG she'll be an internet expert soon
 
@DeadMG you mean that that's you, helping the mother of your owner browse the internet
 
@DeadMG repost. Wait, no, the other one had the finger nearer the cursor-down key, I believe
 
no, I'm pretty sure it's a repost.
@TonyTheLion She can probably spell better than you :P
 
12:09 PM
@DeadMG Better go check. This is important. And I'm at work... :(
 
damn
spelling
 
pretty embarrassing to be beaten by a dog on a laptop
 
Jan 23 at 0:07, by rightfold
Repost.
^ this is a repost
got it?
 
user1804599
Pea roast.
 
so
I figure I should start applying for jobs or someshit.
 
12:13 PM
@DeadMG did you actually finish your degree?
 
Xeo
@DeadMG The other image was way worse though
Quality-wise
 
@ScarletAmaranth Nope.
@Xeo Nah, I reposted a much better one a few minutes later after cleaning the camera.
 
Ooo here doggie doggie
 
just hope @thecoshman comes by, he hates it when I dump pictures of Daisy
 
12:20 PM
Daisy!!!
 
she's a useless mutt
 
I got Bailey out of bed, eventually, and took him for a walk.

Needed a new yardbrush anyway..
 
Xeo
@DeadMG Isn't that what pets are supposed to be? :P
 
lol
@Xeo Indeed.
I found it difficult to take shots of her with one hand whilst scratching her with the other.
 
12:22 PM
-3
Q: My mac has slow internet speed

CraigWondering if someone could help me diagnose a network problem. My macbook pro running OSX seems to have a connection bottleneck. I have 100mbs on my other laptop but when I take the same ethernet cable and put it into my mac i'm getting less than 1mbs. Any ideas? I'm getting equally slow speeds ...

 
Xeo
Also, I really wish the two docs I tried to go to today were available
one of them was for an allergy test against cats :|
 
well if you get a kitty just make sure that your camera's ready to go
 
Xeo
I had a mild form of cat (hair) allergy when I was small, but that mostly subsided after living with a cat for quite a long time. I wonder how bad it's today.
@DeadMG It'd be two kitties, since I'm at work for 8h / day
 
they need to play with each other huh
 
Xeo
so they can wreck the flat play with each other while I'm gone
@DeadMG Ye. I feel like it'd be a pretty bad idea to only get a single one and leave it alone for a good half of the day
Also, two kitties means double the cuddle opportunities.
 
12:26 PM
and double the bleeding from the claws
 
Xeo
Red tears of love.
 
hm
 
struct A { static constexpr int a[3] = {1,2,3}; };

int main () {
  int a = A::a[0];
  int b  [A::a[1]];
}
 
Xeo
but yeah, first I need to sort out the allergy thing
 
what do you guys say, is A::a ODR-used in int a = A::a[0]?
 
Xeo
12:27 PM
nope
 
clang thinks it is, gcc doesn't
 
it's not.
 
Xeo
int& a = A::a[0] would be
 
even if it's equivalent of *(A::a + 0)
with the array-to-pointer conversion in mind, of course
 
that's irrelevant.
what matters is that the compiler knows the value of that expression.
 
12:28 PM
+1 because I didn't know a const keyword had been added to javascript. — James Duffy 13 hours ago
 
and doesn't have to produce an address.
 
wtf why is that a good reason to upvote a question that asks "should I use const when declaring libraries?"
 
@Xeo I thought this was a good idea too. It turns out one of them is an asshole to the other. YMMV.
 
@DeadMG but since A::a[idx] is equivalent to *(array_to_pointer (A::a) + idx) that array-to-pointer conversion must know the address of A::a, right?
 
not if the compiler scrubs the whole expression and just substitutes the value in instead.
 
12:30 PM
but is it allowed to do that?
 
not only allowed, required.
 
sure, it's "allowed" to do that.. but what I mean is; can it do that and disregard the conversion to a prvalue?
 
...
 
user1804599
@LightnessRacesinOrbit AFAIK it's a V8 language extension.
 
> required
 
user1804599
12:31 PM
It may be in the latest version of ES, though.
 
not only allowed
REQUIRED.
as in, the Standard says, "YOU SHALL DO THIS".
 
let me rephrase the question then.. why is it required?
 
Xeo
@SamDeHaan I'd get two that have been together before :P
 
that's not a rephrase, that's a totally different question.
and it's required for this exact reason- so that the user doesn't have to dick around defining constexpr values that don't need definitions.
 
@DeadMG that's what I meant to ask, sorry for the confusion
 
12:32 PM
@rightfold It's JS 1.5 actually
 
@DeadMG where is this stated? sure it says that literal types can appear where a constant expression is required, but it doesn't say how one should treat it when it doesn't appear in a constant expression
 
the RHS is a constant expression.
 
it's not required to be
 
Yeah, we have UI designed for use with fingers. Read: we have exactly what the Windows PDAs were, but three times larger. Good job, technology. — Lightness Races in Orbit 51 secs ago
 
@Xeo I got mine at ~8weeks, from the same litter. One of them just ended up being an asshole.
 
12:33 PM
well, yes, it is.
 
@DeadMG ... how so?
 
@DeadMG prove it plz
 
because the compiler knows in advance exactly what A::a[0] is.
since you declared it static constexpr.
 
@DeadMG and the Standard mandates this?
 
3 mins ago, by DeadMG
as in, the Standard says, "YOU SHALL DO THIS".
you can actually read, right?
 
12:34 PM
it mandates that A::a[0] must be able to be evaluated where a constant-expression is the only option, it doesn't say anything about other contexts
@DeadMG sure.
 
good.
so let me tell you what the Standard requires.
 
but the initialization of int a = ...; must not be a constant expression
 
the initializing expression can be.
 
hence; the rule of it being usable in a constant-expression certainly doesn't apply
it can be, but it's not required to.
 
if I say int a = 1; then 1 is still required to be a constant expression, irrelevant of what it's used to initialize.
 
12:36 PM
...
alright, let me put it this way: int a = 1+2+3;
constant-expression or not?
 
1 + 2 + 3 is indeed a constant expression.
 
it's not required to be
 
o rly?
so you think that std::array<int, 1 + 2 + 3> x; isn't required to compile?
 
let me dig up the example of just that thing (from the Standard)
it is
 
well there you go.
it has to be a constant expression, else you can't pass it to the template.
problem solved.
the Standard requires that A::a is ODR-used if and only if the user uses it in a context that requires the address. Your example context does not, it only requires the first value in the array and the compiler already knows this value. That's why A::a is not ODR-used.
 
12:38 PM
you are not paying attention
 
anyone remember what section the example equivalent to int a = 1+2+3; int b[1+2+3]; is in the standard? saying that the latter is required to be evaluated during translation, but the former isn't?
 
being evaluated during translation isn't a hallmark of constant expressions.
a constant expression can be evaluated during translation.
it doesn't mean that it always is.
some contexts require that it is, some don't.
 
it doesn't mean that it isn't a constant expression just because it isn't always evaluated at compile-time.
 
12:40 PM
[expr.const]p5, the difference between must and may
 
this is the eternity of confusion around constexpr functions.
 
since a constant expression is not required in int a = A::a[0]; we cannot follow the rules saying that A::a is usable where a constant-expression is required
 
A::a[0] is a constant expression, regardless of whether the context you use it in requires for it to be evaluated at translation time.
 
I'm having dejavus.
 
@DeadMG int x = func (123); having constexpr int func (int a) { return a * 2; }
@DeadMG that is not required to be equivalent to int x = 246; during translation
 
12:43 PM
func(123) is still a constant expression, although the compiler has the right to delay evaluation until runtime if it wants to.
 
it may be evaluated during translation, but it doesn't have to be
 
but A::a[0] is different.
 
@DeadMG in what way is it different?
 
and it's different because it's user-observable whether or not the compiler evaluated it during translation or not.
 
no it's not
 
12:43 PM
IT IS BECAUSE IF IT IS THEN IT'S NOT ODR-USED.
hence the source of the entire conversation.
 
You're just repeating your assertions without proving them, which is fruitless.
 
the compiler has to evaluate it at translation-time because if it evaluated it at run-time then it would be ODR-used.
 
And now your argument is circular
 
what the fuck, did you actually just write that?
 
and the Standard requires that it is not ODR-used if A::a[0]'s address is not used.
 
12:44 PM
OK, popcorn time.
 
hence, A::a[0] cannot be evaluated at run-time.
 
the question is if it's ODR-used or not, you can't prove that by saying that it's not becuse if it would be it would be
2
 
facepalm
 
@DeadMG but we are taking the address of A::a since A::a[0] is equivalent of *(array_to_pointer_conversion (A::a) + 0)
 
not really.
 
12:45 PM
how so?
 
the compiler can produce the result of that expression without knowing the address.
 
@FilipRoséen-refp haha :)
 
because it points to a constant array, the contents of which are constant.
 
Isn't the address a compile-time expression?
 
it CAN but there's nothing saying that it MUST
 
12:46 PM
1 min ago, by DeadMG
the compiler has to evaluate it at translation-time because if it evaluated it at run-time then it would be ODR-used.
yes, it must.
 
Your own nonsensical Lounge comments are not an authoritative source of C++ standard requirements. And if they were, that one would be a defect.
 
1 min ago, by Filip Roséen - refp
the question is if it's ODR-used or not, you can't prove that by saying that it's not becuse if it would be it would be
 
@LightnessRacesinOrbit What about yours? :P
 
@FilipRoséen-refp now youre just trolling
 
@Jefffrey NO CARRIER
 
12:47 PM
lol
 
@ScarletAmaranth not really; that's what he said.
 
sigh.
let's try this from another perspective, shall we?
 
@DeadMG so once again; why must it not result in ODR-usage?
 
@FilipRoséen-refp Because ODR-usage is user-observable.
 
and let's us include standard quotations on this one
 
12:48 PM
fuck that
 
@DeadMG and?
 
go ask the robot if you want gratuitous standard quotes.
@FilipRoséen-refp And compilers cannot introduce user-observable behaviour willy-nilly.
well, they can, but not in a conformant manner.
evaluating func(123) at run-time is covered under as-if; the user cannot observe the difference between execution at translation time, and execution at run-time.
 
@DeadMG once again; int x = 1+2+3; vs int y[1+2+3]; the latter 1+2+3 must be evaluated during translation, there's no such guarantee on the former
 
that's why the compiler has a choice.
the compiler has a choice because the user can't tell which choice it made.
but when I say "Do I need to define A::a or not?"
 
and where is it stated that the A::a[0] in int a = A::a[0]; must be evaluated during translation?
the as-if rule doesn't apply here, it's a silly argument.
 
12:51 PM
as-if entirely applies here.
well, it applies in the other example but not here.
 
I've boiled it down to this question:
1 min ago, by Filip Roséen - refp
and where is it stated that the A::a[0] in int a = A::a[0]; must be evaluated during translation?
 
it applies in the other examples because all possibilities produce the same result under the abstract machine.
3 mins ago, by DeadMG
go ask the robot if you want gratuitous standard quotes.
 
but since you refuse to give me anything other than standard quotations I'm guessing I'm talking to the wrong guy
 
more accurately, if I recall correctly, it states that an lvalue is only ODR-used if it's used in certain contexts that require a run-time reference and not the value, or something like that.
 
@LightnessRacesinOrbit I'm quite sure you've been following the discussion. am I missing something?
 
12:52 PM
I didn't know he was obliged to give you standard quotations
 
@ScarletAmaranth he sure isn't, but in order to prove his point that's all we got
@DeadMG the implicit array-to-pointer conversion certainly require the address of A::a
 
it doesn't.
because the compiler can produce the value of the result without knowing that address.
 
@LightnessRacesinOrbit hahahahahah oooh I love you you repwhore
 
@FilipRoséen-refp You've missed the hopelessness of having such a discussion with @DeadMG. :)
 
12:54 PM
doesn't your answer just prove that I was completely correct all along?
 
@LightnessRacesinOrbit in your answer you are missing the array-to-pointer conversion
 
@LightnessRacesinOrbit Holy mother you are unbelievable. :)
 
@FilipRoséen-refp How so?
 
the standard talks about contexts where a consant-expression is required, and it says A::a must be usable there
 
@FilipRoséen-refp I quoted the passage about that conversion to show that it's irrelevant
 
12:55 PM
but it doesn't say that A::a must be usable in a context which doesn't mandate a constant-expression
 
> an array-to-pointer conversion (4.2) that is applied to a glvalue that does not designate an object with static storage duration;
 
wait.. whaa? shii... (this is me feeling stupid)
 
so, I was completely correct all along.
yay me.
 
@FilipRoséen-refp I added the word "necessarily"; does it fit now?
 
@FilipRoséen-refp HA
 
12:56 PM
@DeadMG using the wrong arguments to support your cause
 
@DeadMG And all it takes to convince someone is quoting the fucking standard rather than whittering on with nonsensical circular nonlogic, quoting your own prior nonsensical circular nonlogic as some sort of proof of your own prior nonsensical circular nonlogic
 
wait.. I might not be done yet though, hold on
 
@FilipRoséen-refp shut up you're done
@Jefffrey ;)
I really hope my answer is right btw cos I don't want to delete it
 
it's neither nonsenical nor circular.
 
Is it time for a meta queston about bad chat threads? :)
 
12:58 PM
it's rather simple and the reason why the Standard is that way.
 
@LightnessRacesinOrbit no, I'm not done.. I read your quote wrong
I'm not feeling stupid no more
 
@FilipRoséen-refp You didn't say "usable". You said odr-used. Which is it to be? I think the passages I quoted are pretty clear.
 
o noes
 
What if I tell you that I don't know what ODR-used means?
 
oh yeth
 
12:59 PM
yes, bla bla bla constant-expression "that does not designate an object with static storage duration" bla bla; but the standard doesn't mandate a constant-expression in that context so the evaluation might still be post-poned
 
then you don't need to feel bad.
 
here come the downvotes. question is, does someone disagree with the answer, or is that for self-answering?
 
@LightnessRacesinOrbit I disagree with it, but I haven't downvoted it (yet).
 
@FilipRoséen-refp "A variable or non-overloaded function whose name appears as a potentially-evaluated expression is odr-used unless it is an object that satisfies the requirements for appearing in a constant expression"
What's not clear about this?
 
@FilipRoséen-refp Can't be postponed because postponing it would require that it's ODR-used, which is exactly what the passage just said that it can't be.
 
1:00 PM
note satisfies the requirements for appearing in a constant expression, which is not the same as appears in a constant expression
 
and you can't go around ODR-using things behind people's backs if you're the implementation because the user can observe that fact and as-if does not apply; unlike evaluating other constant expressions like 1 + 2 + 3 at run-time.
 
@DeadMG: Just to be sure, do you agree with my answer and with my choice of proof?
 
@LightnessRacesinOrbit what version of the c++11 standard do you have? I can't find the array-to-pointer conversion "thingie"
 
@ScarletAmaranth <3
 
@LightnessRacesinOrbit Seems to be the wording I was thinking of, yes.
 
1:03 PM
@FilipRoséen-refp Oh fuck. Cos my C++11 PDF seems to be broken on this new laptop and I'm stuck quoting from n3242 today. I'll re-verify the wording
 
@LightnessRacesinOrbit there is no such wording no more
I checked both c++11 and the c++14 draft
 
facepalm
 
but you better double check that. I thought/think I'm going nuts
 
I need some good eye-stabbing, preferably with a fork
 
1:04 PM
@FilipRoséen-refp doing it now
 
@LightnessRacesinOrbit Ah, just when I joined to see what the "flamey debate" was
 
@LightnessRacesinOrbit good. if that section doesn't exists it might be ODR usage, and we are doomed
@LightnessRacesinOrbit can you find it?
 
@FilipRoséen-refp bloody hell hold on would you?
I have to set up RDP on my home machine and retrieve my PDF
go make a cup of coffee or something
 
my life depends on this.. if the section is really there (or some other section saying the same thing) I'll have to question my whole existence
smoke break
 
1:09 PM
oh god
 
@FilipRoséen-refp oh god; you're quite a drama queen : - /
 
they shuffled loads of things around
 
@ScarletAmaranth now I'm trolling, yes.
@LightnessRacesinOrbit but I can't find it anywhere else either
 
@Filip Okay so that passage is gone, but it only means they relaxed the restriction for array-to-pointer conversion; no longer does it have to refer to an object of static storage duration to abide by the rules for constant-expression
So you're fine
 
well I'm off to dalk the wog
 
1:12 PM
@LightnessRacesinOrbit we (I) am not fine
now the rvalue-to-lvalue convesion comes into play
 
@FilipRoséen-refp what's wrong now
I'm sorry the what now?
 
s,convesion,conversion,
@LightnessRacesinOrbit 5.19, "an lvalue-to-rvalue conversion (4.2) unless it is applied to"
 
@FilipRoséen-refp what about it?
 
@LightnessRacesinOrbit the array-to-pointer conversion when doing int a = A::a[0] (equivalent of int a = *(array_to_pointer (A::a) + 0)
 
the pointer is an rvalue already so there's no lvalue-to-rvalue applied afterwards.
 
1:15 PM
A::a sure is an lvalue
 
not after array-to-pointer.
 
@FilipRoséen-refp Why do you keep talking about array-to-pointer conversion? I just told you why that doesn't violate the rules for a constant-expression (which in turn means no ODR use takes place)
 
you can't do int*& p = A::a;.
the pointer result of array-to-pointer is an rvalue.
 
how can an array-to-pointer conversion not ODR use an array when the address of said array must be taken? this is what I'm confused about
 
the end result of the expression doesn't require it.
all the wording in the Standard really just sums up as "You don't really need it so forget about this inconvenience".
 
1:18 PM
`A::a` is an lvalue, `[conv.array]` says

An lvalue or rvalue of type "array of N T" or "array of unknown bound of T" can be converted to a prvalue of type "pointer to T". The result is a pointer to the first element of the array.
oh, now I might see what you are talking about
 
@Filip stackoverflow.com/a/23428685/560648 Final section is new and might help
 
[conv.lval] "A glvalue (3.10) of a non-function, non-array type T can be converted to a prvalue"
 
@FilipRoséen-refp What about it?
 
I don't understand the commotion.
 
@R.MartinhoFernandes I got rep. People don't like that.
 
1:21 PM
Have you tried [basic.def.odr]?
 
it's helpful to me since it explicitly states non-array type, but not really relevant
 
Ah, Lightness did.
 
@LightnessRacesinOrbit thank you
 
@R.MartinhoFernandes Sorry I still cite by section/para number. Habit and it looks nicer. I understand why it's a PITA though :(
@FilipRoséen-refp You are welcome. :)
@FilipRoséen-refp ok
 
@FilipRoséen-refp I think that's irrelevant.
a[0] refers to a subobject of the array.
Done.
 
1:25 PM
@R.MartinhoFernandes yeah, it seems to be irrelevant
 
@DeadMG: And that's how you do it. :)
 
time to file the bug reports related to this matter
@LightnessRacesinOrbit it sure is!
 
@FilipRoséen-refp Have fun and make me famous
Tempted to link to the transcript in the question. Slightly.
 
@LightnessRacesinOrbit add it as a note
 
@FilipRoséen-refp It's not really about needing the address.
 
1:26 PM
@R.MartinhoFernandes you are a tad too late, the discussion is over
 
It's needs a weird notion of "address" if you want to model it that way.
 
well, the array-to-pointer conversion yields the address of the first element in the array
 
It's more of a needs a "linker-resolved address".
 
which I took as it ODR-using the array/the first element
but apparently.. that's not the case
 
@FilipRoséen-refp hehe
I think this was my favourite bit:
Or is that sacrilegious...?
 
1:29 PM
I was about to bring that up earlier, you being the robot
 
The cat may be the downvoter :P (don't shoot, it's not me) — Nikos Athanasiou 57 secs ago
HA!
 
@R.MartinhoFernandes Why are you poring petrol on the glowing embers?
 
now I'm going to have at least two smokes, talk to you guys in a bit
 
Yeah, and I'm going to fetch an office chair from Argos, the constexpr/[0]/ODR should be over when I get back.
 
Debugging code that makes heavy use of std::function is a freaking pain in the arse.
Just saying.
 
1:32 PM
Two anonymous downvotes now. Makes me so sad =(
 
It's the usual self-answer-hatred nonsense.
 
@R.MartinhoFernandes Can't you just step into it to get to the target function?
 
@R.MartinhoFernandes Dicks ;(
Well, that was fun. Hadn't done that in a few months or so IIRC
 
@MartinJames No, the problem is that std::function is being used properly, i.e., for storage, and I cannot set a breakpoint for "whenever that particular storage gets called".
All debuggers are primitive as fuck.
 
@FilipRoséen-refp Don't forget to post links etc. Comments on the Q&A wouldn't hurt, either. I would then integrate them into my answer so people know how well this conclusion works in practice.
 
1:35 PM
Start, stop, look at variables sometimes. Great feature set.
 
@LightnessRacesinOrbit I have a follow-up question; int * p = A::a having struct A { static int a[3];};. still no ODR usage? :-S
 
Well, complex code=complex debugging. At least you're doing bettter than most of the C SO posters who cannot debug 'Hello World'.
 
Also, MSVC doesn't have a "don't fucking ever step into this stupid file" option?
I'm tired of stepping through stdlib wrapper ladders to get to my code.
 
@FilipRoséen-refp Hang on a min I need to open the Ask Question page again
 
@LightnessRacesinOrbit ... pff
 
Xeo
1:41 PM
@R.MartinhoFernandes alt-shift-F11 or something
to select where to jump to
 
You mean "Step into specific"?
That's not it.
 
@FilipRoséen-refp That's odr-used. "an lvalue-to-rvalue conversion (4.1) unless it is applied to <none of these apply>"
 
I'm not using MSVC but why not set breakpoints where you actually want to step, and when it jumps to the library make it keep going until it hits a breakpoint
 
I don't wanna skip the call entirely. I want to step into it, but without having to make stops at every single pass through call in the stdlib before it reaches my code again deep down.
 
Xeo
@R.MartinhoFernandes "Step into specific" should allow that, no?
 
1:44 PM
i.e. I want to step into some_std_function(), but not see std::function::operator() and friends, which are complete waste of time.
 
Xeo
oh wait, no, that was for immediate expressions
 
@LightnessRacesinOrbit of course.. thank you (once again)!
 
user1804599
Ahah.
 
@FilipRoséen-refp You're welcome again.
 
user1804599
function ∘($f, $g) { ... } works, lol.
 
1:44 PM
maybe I shouldn't be on the internet hungover.. it never ends well
 
user1804599
And I can call it with prefix notation.
 
It's literally impossible for me to use the MSVC debugger without finding a feature I miss from gdb.
FFS
 
@LightnessRacesinOrbit how I felt soo many times during our conversation/discussion i.imgur.com/r9XLQNI.gif
 
ooh one more favourite here for my first "Stellar Question" gold badge, which would be my 22nd gold badge over all
an my rep is on 114,141, which I find amusing for some reason
 
1:49 PM
Oh, you're catching up.
 
speaking of catching up, Vlad has 21k >.<
@RedShift You need to write function bool operator ==( const Card &a, const Card &b ); You may ask me a question in my forum at www.cpp.forum24.ru in the section "C/C++ for beginners" It is the first section of the forum. Though its is Russian site you may ask questions in English. — Vlad from Moscow Apr 28 at 19:38
flag for spam? ;p
 
Love the title of the page.
It's literally just "Forum"
 
vlad = vladimir?
 
@R.MartinhoFernandes short and succinct ;)
 
@R.MartinhoFernandes haha
 
1:52 PM
@telkitty.exe No. It's Влад.
Also, Cyrillic is starting to read naturally.
 
What how is that possible a writing system is not sentient sir,
or... did you name your daughter "Cyrillic"?
 
user1804599
Cyrillic is one of the ugliest alphabets IMO.
 

« first day (1294 days earlier)      last day (3672 days later) »