From 6737802315831106858
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,7c21e57f4a25e5f3
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-05-08 19:26:04 PST
Path: newsfeed.google.com!newsfeed.stanford.edu!skynet.be!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: "James Kuyper Jr." <kuyper@wizard.net>
Newsgroups: comp.std.c++
Subject: Re: deleted pointers in a container
Date: Wed,  9 May 2001 02:25:15 GMT
Organization: Not Enough
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <3AF8A939.2148534A@wizard.net>
References: <3AF0BE2C.F07A2FB7@acm.org> <OE45ZY5sukPifCLKgE100004423@hotmail.com> <3AF69057.1778277E@acm.org> <3af75302$0$1885@news.denver1.Level3.net> <3AF7F543.D6399AF8@wizard.net> <3af8463b$0$1883@news.denver1.Level3.net>
X-Trace: mail2news.demon.co.uk 989375120 mail2news:17206 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Accept-Language: en,es,de,ru
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 27
Xref: newsfeed.google.com comp.std.c++:4622

Brian Hanley wrote:
...
> My question was, is a pointer-to-member-function necessarily considered
> a plain old data (POD) type?

Yes - section 3.9p10 defines POD types as including scalar types, and
scalar types as include pointer to member types.

> Am I mistaken that calling memcpy() on a (valid) instance of a class with
> virtual functions does not necessarily yield a valid copy?

No, per 3.9p2, that guarantee is only made for objects of POD type.

...
> My point, then, is that specializing standard containers on pointer types in
> order to use memcpy() ...
> - Might allow us to copy invalid regular pointers, but
> - Might break the copying of valid pointers-to-member-functions.

Luckily, pointers-to-member-functions are POD types.

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



