Artöm
It may be missed optimization
Cengizhan
Anonymous
Anonymous
Hello
Pavel
Anonymous
Anonymous
so we could have a logical AND operator that behaved like bitwise AND. that would be inefficient, so the standard has short-circuit evaluation for logical AND.
Pavel
Well, so that means I need to use bitwise AND here to make it explicit that I don't care about short-circuit evaluation?
Pavel
I mean, is the second variant preferable then?
Anonymous
Anonymous
Anonymous
Pavel
Yep, my point is, that it seems to me (but I'm not sure) that the assembly code generated in the second case (with bitwise AND) is more efficient because it doesn't have branching (conditional jumps) in it.
Anonymous
Pavel
Anonymous
Pavel
Here I pasted it
https://pastebin.com/dyAzW4yd
Pavel
because it doesn't have conditional jumps in it, and as I heard they bad for branch predictor
Pavel
Actually I started thinking about that when I found this in UE4 core code
checkSlow((ArrayNum >= 0) & (ArrayMax >= ArrayNum)); // & for one branch
But in that case as far as I remember assembly code was generated almost identically, so I thought it is some old stuff from the days when compilers wasn't so smart
Tokin
Btw are there ppl in here who prefer procedural way of handling solutions.. Instead of object oriented ways.. Even while using C++??
Tokin
Or did I frame the question in a wrong way?
Pavel
OK, I think I got it, thanks for the explanation @lightness_races_in_orbit, @chandradeepdey
Tokin
Definitely it would seem it's better to approach some questions in a certain way.. Coz it'd be easier or efficient in the longer run..
Tokin
Welp.. Maybe I'll ask that question once I dedicate myself to solve problems in a procedural way and then.. After some time.. I'll try doing that in object oriented way..
Anonymous
Anonymous
It's not C with classes
Tokin
In the realm of game dev.. Do ppl prefer OOP as the main paradigm?
Anonymous
/adminlist
Anunay
Heya
Anonymous
Tokin
Anonymous
who is owner of this big community🤩
Anunay
Anunay
He went MIA couple of years ago
Anonymous
Anonymous
Anunay
Missing in attendance
Tokin
Maybe he found something better
Anonymous
Anonymous
Group is full of serious and Focused peps
Tokin
Yeah barely 7% are alive online.. And from those 7% .. Barely 1% are active
Anonymous
Dima
such a suspicious name
Aasif
if I pass a 2d array as an argument to a c++ function like this - void f(char **A), then within the function, can I access A[0][0] as the 0th row and 0th column of char array A?
Alex
Yes
Aasif
okay. thanks!
Lui
/get cbook
Verckys
/get
Verckys
/get cbook
Lui
/get cppbookguide
Andrei
Thanks !
jr somalia
Thanks you 🙏
Веселый Роджер
Heya😁
Can anyone help?
I need to copy the behavior of strlcat
But i dont understand how exactly it works. Can anyone enlighten ?
Manoj
Tq
Огни
What projects you done?
Anonymous
Веселый Роджер
I dont get what to do if a get an empty array. It says both dest and src should be terminated. How do i do that?
Tokin
That was random DST
Огни
I asked a question for us: what projects have you done?
Tokin
Us?
Огни
Огни
accidentally answered the wrong message
Огни
I want to see what people done on c++
Monday Morning
You are given 3 integers a,b &c. Can bitwise OR of (b and c )can be calculated if you are provided bitwise OR of (a and b) and(a,b and c) ?
Огни
Nono, what only one programmer done
Anonymous
Mar!o
Even alone you can write an engine or game or AI
Anunay
Anunay
Or what
Anonymous