Article View: comp.std.c++
Article #2681Re: STL allocator spec broken?
From: John Max Skaller
Date: Tue, 21 Nov 1995 03:04
Date: Tue, 21 Nov 1995 03:04
40 lines
2136 bytes
2136 bytes
wilson@cs.utexas.edu (Paul Wilson) wrote: > >My current understanding of STL allocators suggests that the standard >is badly designed. I'd be happy to be corrected if I'm wrong. Are you talking about: 1) the Working Paper specification, or, 2) The Stepanov/Lee specification? According to the September 1995 WP, you have to pass an allocator type argument to "list", and you have to pass an allocator OBJECT of that type to a list. According to Stepanov/Lee, you have to pass an allocator TEMPLATE. [Note: pass a _template_, not a type] >Am I mistaken that the standard STL allocator model conflicts with what >I want to do? Are instantiations of templates with different allocators >different types, requiring different code to operate on them? WP: no, not always (but they can be) Stepanov/Lee: yes, always. >I suppose >we could write all of our code as template functions and generate two >versions of everything, but that's ugly and not a complete solution. I don't understand: generally you WILL be writing almost all modern C++ code as templates. -- John Max Skaller voice: 61-2-566-2189 81 Glebe Point Rd fax: 61-2-660-0850 GLEBE NSW 2037 email: maxtal@suphys.physics.oz.au AUSTRALIA email: skaller@maxtal.com.au --- [ 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. ]
Technical Details
Message-ID:
<48qk18$i2v@oznet03.ozemail.com.au>Path:
arc1-ca.pugleaf.net!in1.uu.net!bounce-backReferences:
<48leps$pv2@boogie.cs.utexas.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back Date: 21 Nov 95 03:04:46 GMT Approved: fjh@cs.mu.oz.au From: John Max Skaller <maxtal@suphys.physics.su.oz.au> Newsgroups: comp.std.c++ Subject: Re: STL allocator spec broken? X-Original-Date: 20 Nov 1995 19:13:44 GMT Organization: MAXTAL Message-ID: <48qk18$i2v@oznet03.ozemail.com.au> References: <48leps$pv2@boogie.cs.utexas.edu> X-Mailer: Mozilla 1.2N (Windows; I; 16bit) X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMLFB2eEDnX0m9pzZAQF2rwF9Fg0CYCF7IcfgeMqZGCUft8UyOcT7iq0T vbUVLAkj2diMy+WmA7gqjklo+6ZqdcPy =Ram0