« first day (1793 days earlier)      last day (3381 days later) » 

09:00
oh this is great
almost every C/C++ geek knows the 'trick' where a[5] == 5[a] because 5[a] is equivalent to *(5+a)
so *(a++) == a[+]
(obviously not true, but still a funny thought)
which is sad.
Instead of getting modules in VS2015, we got this: blogs.msdn.com/b/oldnewthing/archive/2015/05/25/10616865.aspx
@Mikhail you do realize this a joke right?
~- and -~ are a common golfing trick
But can you guess what x=x-- does?
@Mikhail is my question clearer now?
@Mikhail format your hard drive?
09:05
possibly
(x+1) > x
doSomething(x++,x++)
this is a poor substitute for a girlfriend.
doSomething(fuckGlobalSate(),alsoFuckSomeGlobalState())
UB
And Ferrero created Nutella, and it was good.
@Lalaland I am surprised that they let you on to the plane with 3 batteries
09:27
@Mikhail not necessarily UB even if the order of eval is unspecified; those could alter 2 isolated things :P
Apparently "Focus, fire a gun" is "Blow a kiss, fire a gun". Disappointed.
@ElimGarak not to be confused with the dystopian "Siri, fire a gun."
09:44
@BartekBanachewicz fairly compelling evidence why those people just wearing trainers and jeans are idiots.
10:11
morning
some of my friends just released a new song, have some good music
@chmod711telkitty old as fuck
Wellp, GoDaddy is desperate to sell some domainz.
that's their sole business so Iwould expect so
I am amazed how a company with that name got relevant.
10:23
because "Apple" is better?
GoPuppy.com, 10/10 would purchase
@AnastasiyaAsadullayeva Wellp, we bash Apple on a daily basis.
interesting there are .lol domains now
I bought some .ninja ones I don't use.
int a = 2;
auto b = std::move(a);
auto c = std::move(a); // is this UB?
no.
it is cool
also, do you ever show up when you don't have a question?
std::move == make my value an xvalue. Now think of the rest yourself.
@Puppy every now and then, but not that often :/
@набиячлевэлиь huh why
10:29
@MarcoA. so the value of c is unspecified then? After move assignment a should be in a destructible but unspecified state, but it will very likely still have the same value since moving an int is just a copy
Am I not welcome on my server anymore?
@sehe Of course not
How rather presumptuous of you.
user406009
The mumble server where everyone is muted.
Oh. Yeah. Sorry. I'll drive to work so I can log out. Sorry again
Mutle
@sehe <3
user406009
10:31
@ElimGarak We've all upgraded to Unicode already pleb: ❤
@gnzlbg That's just DB.
Is it also defined behavior for any type?
user406009
@gnzlbg I believe the standard claims that the state after a move is unspecified, but valid. You would need to check the standard to be sure.
IIRC it should be in a destructible but unspecified state, so wether or not multiple moves are supported would depend on the type
and wether or not the type defines double moves as UB or not
10:35
Depends on how dumb the programmer's actions are afterwards.
unspecified but valid might also mean that double moves should not result in UB
Yeah
IIRC the wording is something like "the object can be reset back to a usable state"
@sehe no kisses, no welcome home
Wellp, back to windoz.
@gnzlbg hint: built-in types == no move ctor/assignment
10:41
lol, it's so obvious it hurts.
Hello, no objectifying code quality today, plx.
user406009
But, code is an object.
user406009
It's an it.
@ElimGarak #codelivesmattertoo
10:54
Man, I don't feel like working on the AHCI driver today. I think I'll just play MGSV, then chill, then get back to it. Or sleep. Sleep is good.
@Lalaland what does valid mean? Does it mean destructible? Does it mean move assignable? Does it mean the whole API should work as before?
user406009
user406009
@chmod711telkitty That's all my battery packs.
real programmers don't use displays
kudos to you @Lalaland
@Lalaland Oh is that that slottable display tablet-laptop?
With the plug-in monitor and such
user406009
10:58
No. It's just a keyboard/battery pack.
I see that you deeply feel the polarization of bits in your machine while programming instead of noobishly looking consolas font in sublime text 3
Nah, the OS output is directly output into his brain, through his ass.
user406009
@gnzlbg Probably need to check the standard for that.
@Lalaland oh
@Lalaland unspecified but valid state
oh and it still... requires destruction i guess
@VermillionAzure IIRC that is what the standard says, valid state
i was just wondering what valid means, it is clear that the type should be destructible, but should it be move assignable? should i be able to release a moved from unique_ptr?
11:04
@gnzlbg If I remember correctly... most moves are treated as "rip my heart out of my chest and transplant it into THIS"
@gnzlbg It depends
most code before C++11 worked fine without a real move constructor or perfect forwarding unless they REALLY wanted to use it
oh wtf.. I clicked a link in the comments of a cpp file.. MSVC opened a tab inside it with IE.. THE ENTIRE IDE CRASHED
isn't that right? otherwise everyone would've been using TMP or Boost
GOOD JOB MSVC
@gnzlbg All functions with no preconditions are legit.
did my weekly bushwalk again ...
11:06
@Puppy Thanks puppy. Does that mean that one should not use as precondition "don't call this on a moved from object"
it would not be illegal to have that as a precondition, but frankly, it would be pretty dumb and counter-intuitive.
@gnzlbg If I harvest organs from a human is it still a valid human
user406009
@chmod711telkitty Ah, the glorious outside. Something I haven't seen in the last 18 hours.
some functions might have as precondition
"the object must be initialized" so I guess that those are invalid since they have a precondition
not one that counts here
moved-from objects are still initialized.
11:07
:/
in fact all members except the constructor implicitly must have that pre-condition.
for me valid means even if your object has been moved from it should play nice
but that is very unspecified
@Lalaland Are you based in Seattle or Huston?
user406009
@chmod711telkitty Houston for school.
basically
you should offer as many members as you can.
but there is a get-out if you absolutely need it
11:09
the only thing one has to offer is a valid destructor call
anything else is up to the dog implementing the type
not true at all.
@Puppy Do we destruct moved-from objects ever?
std::swap uses assignment after having been moved from, for example.
@VermillionAzure Every time.
std::swap assigns a valid object to a moved from object
not a moved from object to a valid one
right, so it calls the assignment operator on the moved-from object.
11:10
ah the moved from needs to be assignable
i mean that makes sense, since i moved it, i might want to reuse the storage for something else
not the storage, the object.
moving from an object does not imply destructing the object at all.
it's still a live object of that type.
@Puppy ahhh thanks
so it's really just about the value, not the lifetime of it
Those objects are still alive after, but their fat insides have been potentially taken away and cleaned up the "wound". We're not talking about "tearing shit out", it is surgical precision. And you just let RAII do the rest.
that's not true at all.
Goddamn! -C++
11:12
all you're talking about at most is whatever dynamically allocated resources it has, which can be a completely different thing.
Those objects are still alive but there is no way to say "the only thing that is valid after a move is to assign something to the object or call its destructor"
for example std::vector's size and push_back members have no preconditions
so anybody can potentially still call any function on a moved from object
so you can happily call them on a moved-from object.
pop_back would be a bad choice.
@Puppy i meant reuse its stack storage
11:13
@Puppy Say I move T to an uninitialized T. what then?
Just because you can do stupid shit, doesn't mean you want to.
What is the state of the original T variable?
@gnzlbg That would be a completely different matter.
@Puppy but thats why you should be able to assign to a moved-from object
@VermillionAzure Then UB because you called the move assignment operator on an uninitialized object.
@gnzlbg It has nothing to do with it.
user406009
11:14
@VermillionAzure How would you even get an uninitialized object?
@Puppy oh, then i understood it wrong :/
you should be able to assign to a moved-from object because logically, replacing your current state should not depend on the value of your current state, so the moved-from state as the current state is fine.
what i mean is if i move from a valid to an uninitialized then what
@Puppy so by that rule i should be able to assign a moved-from object to any other object
that's what you just asked.
@gnzlbg Yes, I imagine so. It's not really useful, but should be legal.
11:15
Puppy answered your question. How the hell do you two make something so simple so tangled up :P
I mean, it would be a non issue if the standard would be more concrete
maybe its better if code
the Standard cannot be more concrete.
they couldn't choose a better word than "valid"
11:16
ultimately
what the Standard means is that "moved-from" is not a special case.
I dont know the more I think about it the more it all falls down to me
it's just that you don't know what non-special case you have.
it's no different to accepting some T as an argument and not knowing what state it is in.
move semantics working or not for user defined types depends on a programmer following a convention and not screwing up
there is no way for the compiler to verify anything since it is just a convention outside the type system
11:17
the program working at all relies on the programmer not screwing up.
he could simply de-reference NULL if he chose to.
you can't make the program work if the programmer is not the sharpest tool in the shed.
yes but to me if i want to know what i can do on some moved from object I have to go and read that types code
"Valid" means you can do stupid, useless, counter-intuitive shit if you want to. With move, a lot of it is up to the programmer. He decides what happens when moving, he makes the mistakes. Hence, the unspecified bit.
@gnzlbg Yep, Halting Problem's a bitch.
yes :/
@gnzlbg Same as any other member function.
11:18
Yes :/
there's no reason why the programmer could not make operator+ nuke his object's state and make any further member calls UB.
Just saying, destructive move doesn't have the problem
well, sure it does.
you moved from it its gone, the compiler can check that once you move from it you don't use it anymore
you need to know in advance whether or not a destructive move has actually been applied or not.
11:19
you cannot assign it or pass it anywhere
you could still dynamically and unprovably maybe destructively move from it.
ah fuck
yes you are right
as per usual really
yes, two pointers to it, destructive move via one
no way that can work
or just if (rand() % 2) destructive_move();
11:21
Something tells me gnz's codebase is probably subject to a war tribunal.
well the compiler can treat a "maybe did that" as "always did that"
nope
the compiler can't do that at all.
Compiler can't do shit.
Somebody actually asked about December 1st
Huh
Wat is that guy doing.
11:22
wat?
if(a) {
  b = std::destructive_move(c);
}
e = c;  // error: c has been potentially destructively-moved from
user406009
Rust is able to guarantee you only move once :)
@Puppy so both are moves?
@VermillionAzure wat?
@Puppy There was a joke a few days ago, the guy took it seriously.
11:23
i can choose to destroy it as a part of move or not?
and they're both valid under the standard?
@VermillionAzure No.
well okay then
destructive move is not an actual thing, it's a proposed future thing, at best.
@Puppy ah i see
user406009
@gnzlbg Yep, the trick is to be pessimistic. So potentially valid programs can be marked as invalid, but no invalid programs get marked as valid.
11:23
So moves should just transfer state, not destro it
yes.
Why is that unclear still?
@ElimGarak Idk I had this weird idea that xvalues somehow affected something about lifetime
with expring variables and stuff
that's why moved-from objects need to be destructible
they are still valid, and their destructors will run at some point
and the user may call a whole shebang of members on them
user406009
11:25
Can't you legally just use std::swap in place of most moves?
user406009
And get similar behavior.
@sehe To avoid confusion I said nuthin'!
nope.
@gnzlbg So basically, it's just supposed to be a sloppy copy with no regard to the original source except for its validity
for one how the fuck would you implement std::swap without moves
and for two many moves don't have a destination object, i.e. move construction
11:25
@Puppy non-const copy?
@VermillionAzure No such thing.
@Puppy ??? i'm confused do you mean move as in sloppy copy without regard to source state or as in moving of values
it's theoretically legal for a copy constructor argument to be non-const, but that's a fucking stupid thing to do and makes it not actually a copy anymore.
because don't copy and move both transfer value?
copying doesn't transfer value at all.
it copies the value.
11:27
@Puppy Hmmm
the hint is in the name.
@Lalaland You talkin' truth
@Puppy Wait so if I use the example of copy/move an arrays
one would make a new one and then copy values over
the other would simply adopt the address of the moved-from data and initialize a new one for the original?
Do you guys even know what move solves?
@ElimGarak optimal deep copy
(...right? O.O)
11:29
It's literally not a copy.
no.
user406009
@ElimGarak 2 primary things. 1: Avoid unneeded copies. 2: Some objects cannot be copied.
finally a wall of code tagged both and
1
Q: Ruby extension crashes when using inherited class

LaurowynI'm currently attempting to include a Ruby interpreter into a game I'm making. Essentially, the Ruby scripts will allow a user to write an AI script to control entities within the game. The structure for this that I currently have is every Ruby script that is loaded will run once at the top leve...

@Lalaland Not you :P
well, turns out this room isn't closing. :D
it was a joke
I see
11:30
I sehe
sorr i'm tryijng to play rising thunder
@edition rising thunder match
jesus 324 ping
wtf
@Lalaland yeah that
especially helpful for returning state from expiring variables or something like that
@edition You do realize if they had intended to shut us down, we would've been shut down immediately and without notice?
And then we would make Lounge<Resurrection>.
@ElimGarak what if they shutdown that as well?
f is a function that returns an rvalue anyways?...???
user406009
11:38
@edition We would move to either mumble or IRC or something.
@Lalaland I wonder if anybody in the Lounge has given Rust a serious try. The whole ownership model sounds quite interesting.
@Lalaland THEN WHAT IF THEY CONSPIRE AGAINST US, AND SHUTDOWN THE IRC SERVER AND THE MUMBLE SERVER?????
@edition That would result in a federal indictment.
user406009
@fredoverflow StarGazer was written in Rust.
user406009
It worked quite well.
11:40
What is StarGazer? Who wrote it?
user406009
Me.
@ElimGarak lol. I was joking :D
user406009
StarGazer was an extension for showing you who starred which messages.
user406009
11:41
SO killed it only 14 days after launch though.
Why?
cool name, btw
user406009
I don't know.
user406009
11
A: I'm seeing stars! (I can see who starred a message and so can you)

balphaI have always considered stars to not be secret (they aren't secret on the Q&A sites either, where they're called "favorite"). I can see how some people make that assumption though, since we don't really show "who starred this" in a dedicated UI, mostly because, well, we never created such a thin...

oh wow
people are in mumble
but not talking
user406009
Don't exactly have a mic on me.
11:45
has anyone posted really dodgy stuff as questions or answers on SO?
@edition You did, 5 minutes ago.
user406009
What qualifies as "dodgy"?
user406009
Everyone has written shitty questions or shitty answers.
7
Q: Industrial-strength n-ton base class template

fredoverflowI am working on an n-ton base class template. I don't worry about laziness yet, so the Intent is: Ensure a class has only n instances, and provide a global point of access to them. Here is my code so far: template<typename Derived, size_t n = 1> class n_ton_base // Singleto...

@VermillionAzure std::move doesn't do what you think it does. And that is the worst example of anything move-related ever. You need an introductory course on move semantics. Someone here probably made a FAQ-like move semantics intro answer on SO. Google is your friend.
11:47
@fredoverflow what's a n-ton class?
@MarcoA. It's a generalized Singleton (n = 1).
In other words, the worst idea ever.
In fact, Puppy did.
49
A: What does T&& (double ampersand) mean in C++11?

PuppyIt denotes an rvalue reference. Rvalue references will only bind to temporary objects, unless explicitly generated otherwise. They are used to make objects much more efficient under certain circumstances, and to provide a facility known as perfect forwarding, which greatly simplifies template cod...

@ElimGarak yuppers
11:48
Upstairs.
659
Q: What are move semantics?

dicroceI just finished listening to the Software Engineering radio podcast interview with Scott Meyers regarding C++0x. Most of the new features made sense to me, and I am actually excited about C++0x now, with the exception of one. I still don't get move semantics... What are they exactly?

That as well. I am truly stumped by the amount of people who were and are stumped by move semantics. It's like the most natural thing ever.
user406009
@ElimGarak Not really. And then there's the fact that other languages don't really have move semantics.
except Rust
11:52
@ElimGarak it is not, I've been banging my head with them for quite some time before I got something right
People have literally been doing shit upside down for decades. I want to give you something because I am going away on a vacation to Belize. Let me just go home, make an exact replica for you right there in your hand, take a potentially annoying amount of time while you wait, then destroy the original in front of you. And then board a plane to Belize.
kudos if that's obvious to you, it wasn't to me the first time
Morning :)
user406009
Good morning.
11:53
Move semantics aren't obvious because most C++ programmers have no clue what an rvalue is, or even worse, think they know what an rvalue is, but couldn't be more wrong about it.
7
@fredoverflow let me star that
Good point.
@fredoverflow yup
I find it disappointing that most of C++ books don't even cite the word 'rvalue'
user406009
The newer ones probably do.
11:54
I think Bjarne made a remark "Babies can do it, why can't programmers?". Not sure were there actually slides of babies exchanging a toy.
not that they had to dive into language lawyering
@ElimGarak cfr. how are babbies formed
a widely popular C++ yet-unsolved issue
@ElimGarak It's a bad analogy. Toys don't manage resources.
I think he was going for the lolz, not sure tho. It was a passing remark, someone posted the video here.
@fredoverflow toys also don't have the possibility to spawn nasal demons... i think
Unless you stick them in your nose ;)
11:56
@fredoverflow BLESS YOU!!!!!!!!!!!!!!!!!!!!!!!
#blackplaguesafety
user406009
@MarcoA. . Well, first you see you have two classes which interact a lot with each other. Interaction breeds familiarity until the two classes are heavily intertwined. Eventually, some common logic grows between the two classes. Finally, that common logic moves into a new class. And thus class reproduction continues.
@Lalaland still doesn't explain how is pointar formed
@Lalaland Ah, I'm glad I'm getting my ever-so-charged "signals-and-slots" talk from you. I wish my parents gave me this--it would make networking so much easier
I think the Lounge<C++> regs could spawn a pretty good C++ ebook.
You're not the first to bring up that idea.
11:59
@ElimGarak yup
and it shouldn't be let fall down

« first day (1793 days earlier)      last day (3381 days later) »