Telegramy
Articles
About
« Rev
@programminginc
443
Fwd »
BinaryByter
Maxi u mean function like this one?
#nomoreusingnamespace
BinaryByter
I could make a RAII wrapper
BinaryByter
https://en.cppreference.com/w/cpp/utility/functional/reference_wrapper
MᏫᎻᎯᎷᎷᎬᎠ
yea something like that
Then just type auto& rv = getVector();
BinaryByter
Then just type auto& rv = getVector();
and then?
MᏫᎻᎯᎷᎷᎬᎠ
and then?
Ur goal?!!!
MᏫᎻᎯᎷᎷᎬᎠ
🤷♂
BinaryByter
Ur goal?!!!
won't compile because of
MᏫᎻᎯᎷᎷᎬᎠ
#nomoreusingnamespace
Khkh
BinaryByter
BinaryByter
well it will compile
BinaryByter
but i have the maximum warnings mode on
MᏫᎻᎯᎷᎷᎬᎠ
But it did in mine
BinaryByter
which means that you will get a reference to a glaring cup of empty
MᏫᎻᎯᎷᎷᎬᎠ
but i have the maximum warnings mode on
Run-time fucking error
BinaryByter
Run-time fucking error
yup
BinaryByter
x-actly
BinaryByter
so time to make myself a reference wrapper in util
MᏫᎻᎯᎷᎷᎬᎠ
so time to make myself a reference wrapper in util
Wht is this
BinaryByter
Wht is this
i'll send a screenshot in like two minutes lol
MᏫᎻᎯᎷᎷᎬᎠ
i'll send a screenshot in like two minutes lol
Thx :-D
BinaryByter
here ya go
BinaryByter
@BOND_0O7
MᏫᎻᎯᎷᎷᎬᎠ
@BOND_0O7
I'm here
MᏫᎻᎯᎷᎷᎬᎠ
Let's c it
BinaryByter
dont bail out when seing variadic template args lol
MᏫᎻᎯᎷᎷᎬᎠ
I didn't understand anything😂😂
MᏫᎻᎯᎷᎷᎬᎠ
Sorry
MᏫᎻᎯᎷᎷᎬᎠ
Lemme Google sth
MᏫᎻᎯᎷᎷᎬᎠ
Class..
BinaryByter
fixed compiler errors lol
klimi
Throw hmmm
MᏫᎻᎯᎷᎷᎬᎠ
fixed compiler errors lol
Sorry maxi I don't know wht class ... means :-(
MᏫᎻᎯᎷᎷᎬᎠ
I wish I could help u
BinaryByter
I wish I could help u
no you don't need to help me
BinaryByter
I just showed you my generic RAII wrapper
BinaryByter
Throw hmmm
too lazy to write an exception class
BinaryByter
gotta do that later
MᏫᎻᎯᎷᎷᎬᎠ
I just showed you my generic RAII wrapper
And I don't know wht the hell it is 😆
BinaryByter
class... unpacks a variadic template/variadic function argument
BinaryByter
luckily we have compile time template resolution
BinaryByter
else it might become very tedious
BinaryByter
Time to slowly change everything step by step in the hope of not breaking anything
BinaryByter
or no
BinaryByter
lets start by unit testing
Ибраги́м
Dudes does anybody know how to return a reference to a vector that was created inside of a function?
Suicide 101!
BinaryByter
Suicide 101!
whats the better option?
Ибраги́м
std::move doesnt seem to do what I want ot
s/snt/s
Marie
std::move doesnt seem to do what I want ot
std::move does seem to do what I want ot
BinaryByter
std::move does seem to do what I want ot
so how would I return a vector without copying?
MᏫᎻᎯᎷᎷᎬᎠ
std::move does seem to do what I want ot
Hello :-D
BinaryByter
so how would I return a vector without copying?
@OxFFFFFFFF
MᏫᎻᎯᎷᎷᎬᎠ
so how would I return a vector without copying?
Reference men :-D
BinaryByter
Reference men :-D
again: it doesnt work
MᏫᎻᎯᎷᎷᎬᎠ
Maxi u mean function like this one?
Well why it does here?
BinaryByter
Well why it does here?
you return a glass of glamourously glaring glazed empty
BinaryByter
you return a glass of glamourously glaring glazed empty
dat killer alliteration
BinaryByter
it compiles
BinaryByter
but not when you add the static code analysis flags
MᏫᎻᎯᎷᎷᎬᎠ
Sorry
BinaryByter
Lol no problem ;)
MᏫᎻᎯᎷᎷᎬᎠ
O:-)
BinaryByter
BinaryByter
lol got the time down by a decent portion
MᏫᎻᎯᎷᎷᎬᎠ
It worked?
BinaryByter
yea
BinaryByter
instead of return vector return std::move (vector);
BinaryByter
though I don't return a reference
BinaryByter
I return a POV
MᏫᎻᎯᎷᎷᎬᎠ
Congrats
BinaryByter
thanqyoue :D
MᏫᎻᎯᎷᎷᎬᎠ
Pretend like I know wht u r talking about?😂
BinaryByter
Pretend like I know wht u r talking about?😂
Lol it's okay
MᏫᎻᎯᎷᎷᎬᎠ
I know that
Ибраги́м
so how would I return a vector without copying?
Move
BinaryByter
Move
okay did it
Ибраги́м
okay did it
U stubborn bone
BinaryByter
U stubborn bone
why?
BinaryByter
I love myself
Ибраги́м
why?
U did what u were avoiding
« Rev
@programminginc
443
Fwd »