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


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

Re: Defect Report: Unclear wording about capacity of temporary buffers

From Daniel Krügler <daniel.kruegler@googlemail.com>
Newsgroups comp.std.c++
Subject Re: Defect Report: Unclear wording about capacity of temporary buffers
Date 2011-08-11 08:18 -0600
Organization A noiseless patient Spider
Message-ID <j1uftr$dmv$1@dont-email.me> (permalink)
References <4E41787B.8080307@f2.dion.ne.jp>

Show all headers | View raw


Am 10.08.2011 19:48, schrieb Kazutoshi Satoda:
>
> 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.

If at all this looks more like an editorial problem to me, no real
defect in the wording. I also believe that the suggested form "having
up to n capacity" is bad English.

Greetings from Bremen,

Daniel Kr�gler


--
[ 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 | NextPrevious in thread | Next 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