legalize+jeeves@mail.xmission.com (Richard): Feb 15 08:54PM [Please do not mail me a copy of your followup] Over the next few months, I'll be doing some presentations on network programming. The presentations will be virtual and uploaded to YouTube afterwards. You can see them in the Utah C++ Programmers meetup group here: <https://www.meetup.com/utah-cpp-programmers/> in the 'Events' tab: - Getting Started with Boost.Asio: Timers and Serial Ports (March) - TCP/IP Networking with Boost.Asio (April) - Basic HTTP and WebSocket Programming with Boost.Beast (May) - C++ Promises/A+ library in the Javascript style (June) -- "The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline> The Terminals Wiki <http://terminals-wiki.org> The Computer Graphics Museum <http://computergraphicsmuseum.org> Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com> |
legalize+jeeves@mail.xmission.com (Richard): Feb 15 08:59PM [Please do not mail me a copy of your followup] (Richard) legalize+jeeves@mail.xmission.com spake the secret code >Over the next few months, I'll be doing some presentations on network >programming. [...] Past presentations on YouTube: <https://www.youtube.com/@UtahCppProgrammers> -- "The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline> The Terminals Wiki <http://terminals-wiki.org> The Computer Graphics Museum <http://computergraphicsmuseum.org> Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com> |
Chris Vine <vine24683579@gmail.com>: Feb 14 04:45PM -0800 On Tuesday, 14 February 2023 at 23:16:11 UTC, James Kuyper wrote: > implemented using exclusively increment or decrement operations, and the > same can be done in user code, I don't see this as an argument > preventing user code from copying the object byte-by-byte. We are agreed on your last sentence. I have been of the view that user code can copy a trivially copyable object byte-by-byte, for the reasons I gave. However, on rereading your posts, I am unclear whether you maintain that the OP's original code has defined behaviour: that is, whether or not it falls foul of [expr.add]/4 (the rules concerning pointer arithmetic). If you think the code doesn't have undefined behaviour, is that on the basis that because auto x = p[2]; achieves the same result as an incrementing version unsigned char* tmp = p; ++tmp; ++tmp; auto x = *tmp the former must be treated as OK whatever [expr.add]/4 may on the face of it say to the contrary? (Here 'p' is the pointer p in the OP's original code.) |
Vir Campestris <vir.campestris@invalid.invalid>: Feb 15 05:38PM On 13/02/2023 10:53, Frederick Virchanza Gotham wrote: > [0][0][0][0][a][b][c][d] > However that is not how they store it. They do: > [a][b][c][d][0][0][0][0] The address _is_ in network order. It's just it's not in the word where you expected it. I'd expect to be able to make a union with unsigned char[4] and see the data correctly - and this mapping does that. Andy |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment