« first day (903 days earlier)      last day (4050 days later) » 

12:01 AM
By now I'm fairly sure that the only thing aliases bring you here is reordering some arguments.
> 'template<class ...> class Context' is not a template
orly
 
Xeo
Too tired to function right now, will head to sleep. G'night.
 
@Borgleader Dat accent
 
When interviewing a french speaking gam dev from montreal --> 50% chance of major accent (Source: BorgStats)
 
12:26 AM
You know it's friday when even the lounge is empty
 
Ell
I'm here!
 
Well, nearly empty anyway. TBH, I used the delete key a lot just to get this one post out. A bit ratted. Going sleep now.
 
how do I stop being Crowz?
 
You don't. You'll always be Crowz to us
 
I... is that a good thing?
 
12:31 AM
@Crowz Fly over our house. You have a reasonable chance of being an ex-crow.
 
"our" house? You all live in a single house?
 
Fuck, Ihave to go bed.
 
fuck
 
Ell
fuck
 
user142019
suck
 
12:44 AM
why is Lindsey Stirling in so much random music?
 
how does inheritance work for reference parameters?
class B:A if I have a method Parse(A& Item); And Item is instance of B
is that still valid?
 
Yes. Well, disregarding access control.
 
I am just confused on smart pointer initialization
let's say I create auto ItemA=make_unique<NewItem>();
Would I pass ItemA by ref or use *ItemA and work directly with the object?
 
It's not usual that a function cares about the interface of a pointer.
 
@LucDanton what do you mean? Sorry.
 
12:57 AM
Have the functions accept what they operate on, and nothing else.
 
that's my example
I just don't like that ownership is transferred
but is that a good idea?
 
You might be interested in cloning/polymorphic copy.
 
sure, any examples?
 
Google it.
 
but I don't want to copy that object
I want to move it and transfer the ownership
 
1:03 AM
How can you not like that the ownership is transferred if that's exactly what you want to achieve?
 
it seems odd, no?
 
58 secs ago, by Luc Danton
How can you not like that the ownership is transferred if that's exactly what you want to achieve?
Go sleep, freshen up and read again what you just said.
 
I have an object in unique_ptr
then I take that object and pass it by reference
then that object is transferred and moved
but how would the original unique_ptr know that it was moved
 
So, I got in the closed alpha for The Mighty Quest For Epic Loot, and there's an enemy called "Snot Killgrim" who attacks by firing mucus at you.
@Grapes It will be null.
 
@EtiennedeMartel is that automatic?
@EtiennedeMartel how does it know...
 
1:06 AM
@Grapes It's not transferred, it's copied.
 
@Grapes There's no magic involved.
 
The copy is held in a pointer and that's transferred -- but it's not something you had before anyway.
 
I don't understand how the original unique_ptr would know
 
A move constructor for a unique_ptr would look like this.
 
@Grapes You don't pass in a unique pointer, so it is not affected. The function operates exactly on what is passed: the referee.
 
1:07 AM
unique_ptr(unique_ptr<T> && other) : _ptr(other._ptr)
{
    other._ptr = nullptr;
}
 
yes but I am not passing a unique_ptr
 
See? The original's pointer is being set to null.
 
You've written a function that operates on DisplayObject objects (via a reference).
 
std::unique_ptr<int> p(new int);
std::unique_ptr<int> p2 = std::move(p);
that makes sense
but std::unique_ptr<int> p(new int);
std::unique_ptr<int> p2(*p); doesn't
right?
 
Right.
 
1:09 AM
is the second case still valid?
 
@Grapes Exactly, because a unique_ptr does not allocate anything. It just owns the pointer. So you have to pass a pointer.
 
@Grapes Nope.
 
so I have to pass my unique_ptr by ref?
 
No, you pass your a T & (possibly const).
If you want to move the pointer, pass a unique_ptr &&.
 
@EtiennedeMartel Pass by value.
 
1:11 AM
@LucDanton Oh, right.
 
if I pass by vallue
i would never be able to access the unique_ptr that owns that object
so I would never be able to move ownership
no?
 
What?
No, you pass the pointer by value.
 
@Grapes When and where?
 
oh god
Going back to pastebin.com/N3rvUVLi
void DisplayObjectContainer::AddChild( DisplayObject& NewEntity )
I don't think that's a correct way
I want to move my ownership of the object that owns NewEntity
 
What are you trying to do?
 
1:13 AM
I am trying to make a unique_ptr
 
Well, pass the pointer.
 
pass it to AddChild
Sorry, pointer to what?
NewDisplayObject.get()?
 
"the object that owns NewEntity" is the pointer.
I'm talking about unique_ptr here.
 
auto NewDisplayObject=make_unique<DisplayObjectContainer>;
that's my unique_ptr
NewDisplayObject? the whole tihng?
by value?
 
No, the unique_ptr<DisplayObjectContainer>.
Oh, right.
NewDisplayObject is the unique_ptr.
 
1:15 AM
yes
 
Then pass that.
By value.
 
So my AddChild would look like this:
void DisplayObjectContainer::AddChild( std::unique_ptr<DisplayObject> NewEntity )
 
why by value?
 
You could pass it by rvalue reference.
But it's a bit unwieldy.
 
1:17 AM
why not a normal reference?
 
It gives a clear picture of what's going to happen: transfer of ownership.
@Grapes You can't know from that alone what's going to happen if you pass your pointer.
@EtiennedeMartel No.
 
@LucDanton Hmm?
 
why by value though... shouldn't it be a reference?
 
After an AddChild(std::move(p)) code you know for sure that p has been 'consumed' if and only if it accepts by value.
Anything else and you have to go through the docs/code.
 
void DisplayObjectContainer::AddChild( std::unique_ptr<DisplayObject>&& NewEntity )
would work but it'll only accept rvalue references
 
1:20 AM
@Grapes But then you don't know in what state your argument is unless you know more than just the type of the parameter.
Passing by value is a contract. The other forms can't be.
 
I see.
Good stuff.
 
oh wait i get it now
 
It doesn't make them wrong or useless or 'bad' -- but they're also not a contract.
 
since it's by value, the parameter would now own the pointer
then we move that object inside AddChild with std::move
 
@Grapes In the scope of the function, so when you wear the hat of the implementer of that selfsame function then yes.
 
1:22 AM
@ScottW yep
 
@Grapes I tend to think of the values being moved around. (This is a tangent though.)
 
gotcha
awesome, thanks
much better
I am converting my engine from raw pointers to use smart pointers
4
 
user1357851
!
 
user1357851
lol
 
:)
 
1:25 AM
DisplayObjectContainer...
This sounds like AS3.
 
@ThePhD i stole nothing!
 
Hmmhmmmm.
 
I'm onto you.
 
Ell
@Grapes what is your engine?
3d engine?
 
1:28 AM
2d
directx/opengles es
 
Engines are for noobs.
 
Ell
trudat
;)
 
Yeah, engines are for scrubs !
 
ASCII art ftw!
 
@StackedCrooked I've stolen your protected locker thingy. :D
 
1:31 AM
Give it back!
There's also the async variant.
 
I'm too lazy to switch to 4.8.0 because I don't want to rebuild all my libraries
 
:3c
 
user142019
boo
 
user142019
Looks fnice.
 
1:36 AM
My libraries are always built along with the rest of my code as part of the build process.
 
Modules are in C++17 right?
 
Speaking of, let's try out 4.9.
@Rapptz Nothing in stone.
 
@Rapptz In your dreams :P
 
:(
 
Perhaps there's a reflector thingy. I'm not sure.
 
user142019
1:38 AM
Modules are in Haskell.
 
Fuck, I might die before C++ gets a decent build system.
 
user142019
You will, for C++ is FUBAR.
 
Your mom has some nice modules.
 
user142019
 
Morgan Freeman should write an autobiography called "A Life of Narration" and then make an audiobook read by himself
 
1:39 AM
That seems outside of the scope of the SC.
 
SC?
 
Standard Committee.
Aw shit, changing version means I have to fiddle with some settings.
 
Oh you mean the build system tidbit?
 
user142019
IT'S ONNNN. KOOOOOOOOOOOOOOOORN
 
1:41 AM
@Rapptz Also StarCraft.
 
Some people do strange things.
 
Ell
I have an ulcer on my oral frenulum :'(
 
user142019
@StackedCrooked it's bad.
 
user142019
But answering it is hopeless since OP will keep and keep asking questions in the comments. (Prediction.)
 
VTC as Not Constructive
 
user142019
1:44 AM
Jup.
 
user142019
And too localized.
 
Oh boy, tons of errors.
 
or offtopic for Code Review
 
user142019
And not a real question; he's vague.
 
Either way, doesn't belong here
 
user142019
1:45 AM
And off-topic, yes.
 
user142019
It's basically the worst kind of question you could ask since all closing reasons hold.
 
user142019
(I don't count dupe as closing reason.)
 
$ scons 2>&1 | wc -l
159
 
Ell
1:49 AM
In other news, this song is better: chickenonaraft.com
 
Tss tss.
 
user1357851
amazed how you people always manage to find the weirdest dumbass websites :p
 
@EtiennedeMartel Better than what you usually dump here.
 
Ell
1:53 AM
@ScottW was about to post that :L
 
user142019
 
Ell
"You have been on a raft with a chicken for 12 minutes 16 seconds."
 
@Zoidberg What the fuck moot.
That shit 4chan says thing wasn't a joke?
 
Ell
Don't click on this if you have
a) Epilepsy/you don't like flashy images
b) headphones/speakers on
http://akk.li/pics/anne.jpg
c) I pray this doesn't onebox.
 
user142019
moot would have been God if Miyamoto didn't exist.
 
user142019
1:55 AM
@Ell :)
 
@Ell TABARNACK
 
I always fall for that fucking one.
 
user142019
@Rapptz fail
 
Ell
@EtiennedeMartel heh
I discovered this one today when I clicked on it on facebook
scared the living daylights out of me
 
user142019
1:57 AM
@Ell SWF doesn't onebox:
 
user142019
 
Ell
@Zoidberg I didn't know it was a swf o.O
 
user142019
Yes, JPEG really makes sound.
 
Ell
html can have background sound :L
or is it just .midi?
 
user142019
Yes, HTML is really JPEG.
 
Ell
1:58 AM
well .swf certainly isn't .jpeg
 
user142019
I didn't say it was.
 
@Ell Welcome to the wacky world of Content-Types not matching the file extension.
 
user142019
The file served by the server is an SWF.
 
Ell
Haha
 
user142019
1:59 AM
 
Ell
My very first webpage had a .midi background music and a home made .gif of a jamaican playing steel drums
 
We're doomed
 
Ell
@Zoidberg I've seen that before, it's so cool
 
HTML plays sounds? Since when?
 
user142019
@Ell Metal Gear Solid is real.
 
1:59 AM
@Ell 1998?
 

« first day (903 days earlier)      last day (4050 days later) »