Liste des Groupes | Revenir à cl c++ |
On Fri, 13 Sep 2024 12:54:53 +0200What /are/ you talking about? Do you even know how arithmetic works in C++ ?
David Brown <david.brown@hesbynett.no> boringly babbled:On 13/09/2024 09:26, Muttley@dastardlyhq.com wrote:Oh dear, someones been caught out and is throwing his toys out the pram.Clearly you've never done any low level networking where id fields are fixed>
sized and will eventually wrap. Eg, TCP sequence number. I'm sure there are
a myriad of other examples.
Clearly you can make up a complete load of drivel with no basis in reality.
So let me be /clear/ here. There is /no/ valid use of incrementingBollocks.
something beyond its maximum value. The whole concept makes no sense.
There /are/ lots of valid uses of wrapping types. Sequence numbers inOh right, so for 32 bit TCP seq number instead of just doing:
low-level networking would be one example of that - one which I /have/
used countless times in my work. But that is not incrementing beyond a
max value - it is using a modulo wrapping increment to give a result
/within/ the valid range, not beyond it.
++tcp->seq_num;
which would autonatically wrap after 2^32, in your world we'd have do to:
tcp->seq_num = (uint32_t)(((uint_64_t)tcp->seq_num + 1) % 0x100000000L);
Really?
Don't be an ass.
It is not vague. Did you actually read the cppreference link, or the C++ standards?If it wasn't so vague I wouldn't have needed to ask the question.If you think thats clear I'd hate to see what you consider obtuse.>
>
Have you ever considered that /you/ might be the problem here? Other
people seem to understand it fine. Consider the common factor in all
your difficulties understanding the template parameter.
You really are a poor excuse for a human being.But does all this mean that you now understand what the integer templateAww bless, so kind.
parameter is for, and what it does? And do you understand how to use
the counting semaphore? If so, that's great.
Les messages affichés proviennent d'usenet.