From 7074240972877261432
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,c66ceaccc8f25e6b
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-04-05 11:29:01 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: kevin_vanhorn@ndsu.nodak.edu (Kevin S. Van Horn)
Newsgroups: comp.std.c++
Subject: Re: Allocators, standard containers, and assignment
Date: Fri,  5 Apr 2002 19:28:24 GMT
Organization: http://groups.google.com/
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <42aba677.0204051121.59ee7aca@posting.google.com>
References: <42aba677.0203291151.ff4f74c@posting.google.com> <3ca4e319$0$20850$724ebb72@reader2.ash.ops.us.uu.net>
X-Trace: mail2news.demon.co.uk 1018034908 mail2news:26475 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)
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Date: 5 Apr 2002 19:21:19 GMT
Lines: 26
Xref: archiver1.google.com comp.std.c++:10412

"P.J. Plauger" <pjp@dinkumware.com> wrote:

> However it may seem to you, we did discuss this within the committee.
> An allocator for a container is fixed at construction (to the extent that
> you can tell).

Why in the world was such a decision made?  What benefit is there from
such
a choice?  I've already mentioned one great disadvantage of such an
approach:
swap is needlessly complicated and made expensive in some
circumstances.
Another disadvantage is that this choice violates the principle of
least surprise.  One generally expects that after executing "x = y",
then x and y
are identical in all ways that affect their subsequent behavior (with
the exception of addresses of the objects and their constituent
parts).  A similar
comment holds for swap.

---
[ 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.jamesd.demon.co.uk/csc/faq.html                       ]



