Thread View: comp.std.c++
1 messages
1 total messages
Started by Bob Kline
Sun, 01 Oct 1995 22:21
Re: Alignment
Author: Bob Kline
Date: Sun, 01 Oct 1995 22:21
Date: Sun, 01 Oct 1995 22:21
38 lines
2222 bytes
2222 bytes
A few weeks ago, James Kanze wrote a followup to an question I posted about whether the draft standard contained anything to support the validity of some code from "Advanced C++" which appeared to rely on the assumption that a static array of char would be guaranteed to be suitably aligned for holding any data type. In part, he wrote: > In defence of Jim Coplien, I'm too lazy to look up the exact example, > but from the name (LAPD), I'd guess that this is a class whose data will > be read from or written to an external source, and which because of > this, will only contain byte data anyway. (LAPD is the name of the > layer two protocol in the OSI protocol suite.) If this is the case, his > example should work anyway. James: Sorry it took me so long to respond to your hypothesis above, but the news server at our site started dropping articles on the floor just about the time you posted the quoted article, and I only now came across it using the DejaNews search service. The LAPD class contains (among other things) some pointers, which would choke on many machines if the alignment requirements were not satisfied. The answers I got confirmed my suspicion that the assumptions on which the quoted code was relying were invalid. -- /*----------------------------------------------------------------------*/ /* Bob Kline Stream International */ /* bob_kline@stream.com formerly Corporate Software, Inc. */ /* voice: (703) 522-0820 x-311 fax: (703) 522-5407 */ /*----------------------------------------------------------------------*/ --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads