MᏫᎻᎯᎷᎷᎬᎠ
If there is 7 vertual functions quad determines 128 bit right?!
olli
.quad always means the upcoming value shall be stored as quadword (64bits)
MᏫᎻᎯᎷᎷᎬᎠ
And if it isn't enough?!
olli
Since your registers can only handle 64 bit you need to split it
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
2 × quadword
MᏫᎻᎯᎷᎷᎬᎠ
:D
MᏫᎻᎯᎷᎷᎬᎠ
So if I have A and B And B inherits A There are two vtables here And I wrote B b: A& a = b; "a" has two vtables("a" and "b") or B vtable?!
olli
Vtables will not be generated if a class does not contain virtual members
olli
Since there is no need to make use of "dynamic" dispatching
MᏫᎻᎯᎷᎷᎬᎠ
So If we said A a; //has a A vtable But B b; A& a = b;//has B vtable
MᏫᎻᎯᎷᎷᎬᎠ
Vtables will not be generated if a class does not contain virtual members
Of course Assuming we have a virtual functions!!!
olli
So If we said A a; //has a A vtable But B b; A& a = b;//has B vtable
Yes, in your first example a has a pointer the vtable for class A In your second example b has a pointer to the vtable for class B. Creating a reference (a) to it does not change the object. So the object refered by a still has a pointer to the B vtable
olli
And that's how polymorphism works, you call a function on the a reference, it looks up the function to execute inside its Vtable (which is for class B) hence the implementation of class B will be run
MᏫᎻᎯᎷᎷᎬᎠ
I get it now
MᏫᎻᎯᎷᎷᎬᎠ
Damn it's complex topic
olli
Yes, indeed! But it's quite interesting as well (at least I consider it to be)
MᏫᎻᎯᎷᎷᎬᎠ
Yeah I like it
MᏫᎻᎯᎷᎷᎬᎠ
Don't get me wrong that I didn't get what vtable is But Derive class's function can override the base class ones
MᏫᎻᎯᎷᎷᎬᎠ
So What is there any difference between virtual and non-virtual
Anonymous
Any one know about Arduino
MᏫᎻᎯᎷᎷᎬᎠ
Any one know about Arduino
Just hit the search in google "Arduino telegram groups"
olli
So What is there any difference between virtual and non-virtual
For non virtual, "overriding" sometimes it can be used to maximize performance. Isocpp calls this "legal but it ain't moral" For virtual: to allow polymorphism If this answer the question
Anonymous
Wich language need for Arduino
Mihail
But that's almost identical to C++, just a bit simpler
Mihail
So just learn that
olli
So Polymorphism can't be done with non-virtual functions
Yes! And polymorphism always has some kind of performance impact. There are several talks/research projects to minimize the performance hit.
MᏫᎻᎯᎷᎷᎬᎠ
Unfortunately I read the rest XD
MᏫᎻᎯᎷᎷᎬᎠ
What is hot functions!? XD
MᏫᎻᎯᎷᎷᎬᎠ
Men If you don't wanna answer this it's okay
MᏫᎻᎯᎷᎷᎬᎠ
You did more than enough
olli
Unfortunately I read the rest XD
Functions that are often called or are rather critical for the performance
MᏫᎻᎯᎷᎷᎬᎠ
olli
I'd say It's better to make them inlined
And that's another problem, you basically cannot inline polymorphic functions since you don't even know which one to call
MᏫᎻᎯᎷᎷᎬᎠ
Of course
MᏫᎻᎯᎷᎷᎬᎠ
But Can I inline a recursive function?!
MᏫᎻᎯᎷᎷᎬᎠ
The code insertion is done in the runtime xD
olli
Well "we" (in the sense of people not developing code generators) cannot force the compiler to inline at all. Recursion might be optimized so a few steps might be inlined but not the whole recursion.
MᏫᎻᎯᎷᎷᎬᎠ
Hmmm
MᏫᎻᎯᎷᎷᎬᎠ
Okay
MᏫᎻᎯᎷᎷᎬᎠ
Thanks
MᏫᎻᎯᎷᎷᎬᎠ
I hope i wasn't pain in the ass as always xD
olli
Your weren't, no worries. Nice to have some discussions in here! time for me to sleep now :D
MᏫᎻᎯᎷᎷᎬᎠ
Okay
MᏫᎻᎯᎷᎷᎬᎠ
Sleep well
itsmanjeet
Hey is their any video tutorial of Machine learning in cpp
itsmanjeet
I search google but their are more with python
itsmanjeet
I don't like that much As it crush the programming interest
MᏫᎻᎯᎷᎷᎬᎠ
See YouTube
MᏫᎻᎯᎷᎷᎬᎠ
Gerard Taylor: C++ Machine Learning Tutorial Part 1 - Extract, Transform, Load (ETL)
itsmanjeet
Thanks friend
MᏫᎻᎯᎷᎷᎬᎠ
Look at the this
MᏫᎻᎯᎷᎷᎬᎠ
Thanks friend
You're welcome
Anonymous
Hello guys
Anonymous
Hey there
Anonymous
Anonymous
how to understand the reference
Dima
Dima
what do you mean?
Anonymous
which is puclic function which is free function
Anonymous
/save callingFunction
Anonymous
I mean the cppreference
Anonymous
Api reference
Anonymous
ໂ😆ໃ
Dima
MᏫᎻᎯᎷᎷᎬᎠ
Wow That saves a lot
Akhil
I didn't understand
Akhil
Pass by value and reference
Akhil
How it works ??
Daniele°
How it works ??
By ref if similar to int * const ref;
Akhil
What is diffrence in pass by value and call by value
Akhil
Yess
Anonymous
what type of array is accepted by main method to store command line args?