Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Defect report: [basic.life]/5: irrelevant example

1 view
Skip to first unread message

Křištof Želechovski

unread,
Jan 22, 2007, 12:24:08 AM1/22/07
to
B* pb = new (p) D1;

pb->mutate();

&pb; // OK: pb points to valid memory

What is this? Taking an address of the scalar object named pb is always
well-formed; it is irrelevant whether pb points to valid memory.

Besides, this expression, having no effect, cannot cause undefined
behaviour.

Chris


---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std...@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]

0 new messages