Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #212

Defect Report: Unclear wording about capacity of temporary buffers

From Kazutoshi Satoda<k_satoda@f2.dion.ne.jp>
Newsgroups comp.std.c++
Subject Defect Report: Unclear wording about capacity of temporary buffers
Date 2011-08-10 11:48 -0600
Organization unknown
Message-ID <4E41787B.8080307@f2.dion.ne.jp> (permalink)

Show all headers | View raw


N3290 (2011 FDIS) 20.6.11 [temporary.buffer] paragraph 1, for
get_temporary_buffer()
>  Effects: Obtains a pointer to storage sufficient to store up to n
>  adjacent T objects. ...
I read this as prohibiting to return a buffer of which capacity is less
than n, because such a buffer is not sufficient to store n objects.

The corresponding description in SGI STL is clear on this point, but I
think it is a bit too verbose.
http://www.sgi.com/tech/stl/get_temporary_buffer.html
>  (for the return value, a pair P) ... the buffer pointed to by P.first
>  is large enough to hold P.second objects of type T. P.second is
>  greater than or equal to 0, and less than or equal to len.
Now I propose the following wordings.


Proposed resolution:

Change 20.6.11 [temporary.buffer] paragraph 1 and 2 to

Effects: Obtains a pointer to storage having up to n capacity (in the units of sizeof(T)) to store adjacent T objects. It is implementation defined whether over-aligned types are supported (3.11).

Returns: A pair containing the buffer’s address and capacity, or a pair of 0 values if no storage can be obtained or if n<= 0.
-- 
k_satoda


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

Back to comp.std.c++ | Previous | NextNext in thread | Find similar


Thread

Defect Report: Unclear wording about capacity of temporary buffers Kazutoshi Satoda<k_satoda@f2.dion.ne.jp> - 2011-08-10 11:48 -0600
  Re: Defect Report: Unclear wording about capacity of temporary buffers Daniel Krügler <daniel.kruegler@googlemail.com> - 2011-08-11 08:18 -0600
  Re: Defect Report: Unclear wording about capacity of temporary buffers Martin Bonner <martinfrompi@yahoo.co.uk> - 2011-08-16 21:29 -0600

csiph-web