Dima
just return void*
Dima
( ͡° ͜ʖ ͡°)
Dima
top kek
Vitaliy ◀️TriΔng3l▶️
just return void*
uint8_t* and reinterpret_cast it + offset to different pointer types?
Vitaliy ◀️TriΔng3l▶️
well, that's pretty much struct
Dima
kinda
Vitaliy ◀️TriΔng3l▶️
kinda
But where are you going to store the data behind it?
Vitaliy ◀️TriΔng3l▶️
On the stack, in local variables, until the next function call or alloca?
Vitaliy ◀️TriΔng3l▶️
You can use registers MM0:MM7 (or MM1:MM7 if you are returning a float normally), I guess, ST(1) to ST(7) should be popped when exiting a cdecl function
Dima
outside a scope lmao
Dima
jk
Vitaliy ◀️TriΔng3l▶️
Though you'll probably need a naked declspec to prevent popping from happening after you write to MMX registers
Dima
I see you are into naughty stuff
Dima
I like
Vitaliy ◀️TriΔng3l▶️
And maybe even call the function in inline assembly because the compiler may place some `fld`s between the call and you using the returned values
Vitaliy ◀️TriΔng3l▶️
But now MSVC doesn't even generate x87 code, so the FPU stack/MMX registers are free, I think?
MᏫᎻᎯᎷᎷᎬᎠ
That's a runtime tuple-like library right!!!?
MᏫᎻᎯᎷᎷᎬᎠ
I hope they include it in C++20
Vitaliy ◀️TriΔng3l▶️
What's sizeof(std::any)? O_O
MᏫᎻᎯᎷᎷᎬᎠ
I think sizeof calculate the size of the object not it's heap storage
Vitaliy ◀️TriΔng3l▶️
MᏫᎻᎯᎷᎷᎬᎠ
It's just slow lol
MᏫᎻᎯᎷᎷᎬᎠ
That's enough xD
Anonymous
MᏫᎻᎯᎷᎷᎬᎠ
Anonymous
in execution time it is a constant. so the speed is very cheap 😎
Vitaliy ◀️TriΔng3l▶️
Varun
#include<stdio.h>
void main()
{
int n=2;
printf("%d %d %d",++n,n,n--);
}
How my op is 2 1 2??
Varun
Any 1 up
Varun
??
Vitaliy ◀️TriΔng3l▶️
Note that depending on the calling convention arguments may be evaluated and passed right to left
MᏫᎻᎯᎷᎷᎬᎠ
Vitaliy ◀️TriΔng3l▶️
though not with varargs I guess?
Vitaliy ◀️TriΔng3l▶️
oh well
Vitaliy ◀️TriΔng3l▶️
with varargs it's right to left too apparently
Anonymous
Hi
Vitaliy ◀️TriΔng3l▶️
n = 2
n-- == 2
n == 1
++n == 2
Vitaliy ◀️TriΔng3l▶️
looks okay to me
Vitaliy ◀️TriΔng3l▶️
v@run ^
Varun
Thx ...
Vitaliy ◀️TriΔng3l▶️
Thx ...
Just don't do that
Varun
Okay
Luigi
1,6 is the range?
Luigi
And what 0.0, 1.0 is?
Anonymous
Hi
Parra
how to fucking properly redistribute c/c++ libs programs in win/linux for multiple architectures?
Parra
I'm so fucking tired
Parra
I only could redistribute it correctly with docker
Parra
which is a partial solution..., and only one arch, one os...
Parra
anyone has an idea?
Mat
Parra
xd
Parra
but Java must be distributed correctly, no?
Parra
and it's coded in c/c++
Parra
so they do something to do the distribution
Mat
Yeah, and every os needs a different way to do stuff.
Mat
You can try something like Qt or Xamarin to create a os-indipendent app if it's your goal
Parra
my app is already cross platform
Parra
i just need to distribute it correctly
Mat
Oh
Parra
it even has a plugin system so dependencies are relative
Mat
I lost the problem🤔
Parra
you can install the application without any plug-in
Parra
and then everything works
Parra
XD
Parra
but that's not the idea
Mat
Parra
😂
Parra
it's a nightmare
Parra
the project has complex dependencies that i dont know how to handle
Parra
also, many OS/archs
Parra
I'm just using docker by now
Parra
it's the best way of distributing it
Parra
all packaged, including the OS
Parra
😂
Mat
Flatpak :P but it's linux-only
Parra
yes... that sucks