"rcbilson at plg dot uwaterloo dot ca" <[EMAIL PROTECTED]> writes:

| Consider:
| 
| #include <iostream>
| #include <cstddef>
| 
| class xxx {
|     friend int main();
|     void *q;
|   public:
|     void *r;
| };
| 
| int main() {
|     std::cout << "offset of xxx::q is " << offsetof( xxx, q ) << "\n";
|     std::cout << "offset of xxx::r is " << offsetof( xxx, r ) << "\n";
|     return 0;
| }
| 
| The class xxx is POD, and the two applications of offsetof should be ok (per
| 18.1p5).

No, the class xxx is not a POD because xxx::q is non-public.  Invalid
PR, should be closed.

-- Gaby

Reply via email to