Dima
so learn everything yourself
Anonymous
Anonymous
Docs learnt us all
Dima
I mean about colleges and another stuff
Dima
docs for the win
Anonymous
Docs is the master teacher
Anonymous
Dima
Anonymous
Dima
ok.. anyone prefers that void Get(Object& out) over that Object Get()
Dima
?
Anonymous
Dima
I think or the first one is efficient (I am not talking about rvo and stuff)
Anonymous
sorry this sticker send by her self
Anonymous
i am new in this app
Anonymous
hhhh
Anonymous
i am sorry
Anonymous
Anonymous
i try to change it hhhh
Dima
I know modern compilers support RVO but am just curious
olli
ok.. anyone prefers that void Get(Object& out) over that Object Get()
What does Get do? If you need a function, different from the constructor, to setup your object I would expect that function to instantiate it as well. Due to rvo the performance might not differ at all
Dima
returns local temporary variable
Dima
Object Get() { return Object(); } vs Object obj; Get(obj); void Get(Object& out) { /* work with out there */ }
olli
So in the second case you would be required to write Object o; Get(o); ?
Dima
yes, am curious whats more efficient to use
Dima
or its basically the same if RVO is supported
olli
If the compiler performs RVO the performance might be the same
olli
However, is it not possible to perform the get functionality inside your constructor? (In case you are only creating the temporary object to perform the get Operation) So would only need to write Object o;
Dima
I have something with string manipulations like String cpuName; and calling some platform-depend stuff like cpuName = Platform::GetCpuName.. and so on
Dima
its example
Anonymous
which you tuber channel is best for learning c ?? plz tell me frnds
Anonymous
How to solve this problem
Dima
Easy
Dima
Igor🇺🇦
How to solve this problem
How can you learn something if you ask other to do your learning ?
Jussi
CODEBLOCKS isn't installing in my lappy Can anyone please help
yeah, 1. download any linux distro 2. install it and remove windows 3. use gnu compiler collection
Maaf
Happy Independence Day, 4th of July for US People.
hyp3rbor3ax
How to solve this problem
even/odd with modulo-operator %. the other things with compare-operators <=/>=. Combine them with &&. print with printf
many
depends on socket implementation I guess :D
Is there a way to achieve bi-directional with the same socket at the same time?
many
That means receive and send at the same time
Jussi
Bi-directional?
Jussi
Use 2 sockets
Jussi
And 2 threads
Max
That means receive and send at the same time
simple socket is like that, it can both receive and send
Jussi
It will be async tho
Manuele
Jussi
Nvm
Jussi
Use 1 socket and 2 threads
Dima
many
Use 1 socket and 2 threads
Let me try it out. Get to dive into socket-related manual
Manuele
Even with rvo enabled?
it always depends with what type of data are you working. if you works with big structures, reference is faster, otherwise value
Dima
hmmm yeah I do work with large objects
Jussi
Without ref you always make a copy in cpp
Manuele
i need high parallelism performances with big tensors. with value, i lost more time by coping data than do the calculations
Manuele
First is same as Object& Get()
also this is an option, same result
Dima
Without ref you always make a copy in cpp
But that’s what rvo is about, it does not create a copy
Dima
Return Value Optimization
Jussi
mm
Dima
Most compilers support that
Jussi
is it built in to some compilers?
Jussi
oh
Jussi
didnt know that
Igor🇺🇦
The best way is just to use compiler Explorer an see for yourself
Dheeraj
Done
Anonymous
🤙🤙🤙 Thanks
olli
First is same as Object& Get()
Out of curiosity, how would you implement this function?
Jussi
Return the value normally
Jussi
Let's say you have Object mObject in class
Jussi
Object& Get() { return mObject; } This will return a reference to the member object mObject
olli
okay, I see But then it differs from void Get(Object &) since the class would be the owner of the object
Jussi
How come?
Jussi
The 2 ways are identical