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


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

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

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!news.albasani.net!.POSTED!not-for-mail
From Kazutoshi Satoda<k_satoda@f2.dion.ne.jp>
Newsgroups comp.std.c++
Subject Re: Defect Report: Unclear wording about capacity of temporary buffers
Date Sun, 11 Sep 2011 09:12:15 -0700 (PDT)
Organization unknown
Lines 54
Sender std-cpp-request@vandevoorde.com
Approved stephen.clamage@oracle.com
Message-ID <4E6B83BB.8000307@f2.dion.ne.jp> (permalink)
References <4E58F6CA.5080306@f2.dion.ne.jp>
Content-Type text/plain; charset=UTF-8; format=flowed
X-Trace news.albasani.net ltUBKlaEnqW6gVVxILfcz61Cqi0O5AkLq7WXxpAcEUcU1WPX0K2nRoIRrpREfgJcWn0RsZA2zOHH8zyWOMzkoA==
NNTP-Posting-Date Sun, 11 Sep 2011 16:12:18 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="0s86f2isyqsqxsWaVyQOT9Z8sDo0CFbhuOfxbUePRacJcLP3uSy1i/HUhFZM4jGKLJ0CDBzOJTVoCal94jDifbN0ArEkIc3F0bmrVLVOc9AKuROTIS6XlUyMMk9Jond7"; mail-complaints-to="abuse@albasani.net"
X-Mailer Perl5 Mail::Internet v2.05
X-Submission-Address std-cpp-submit@vandevoorde.com
Cancel-Lock sha1:eNZHmkhPrYgkuNsDb7gw9NDEXPE=
X-Original-Date Sun, 11 Sep 2011 00:35:23 +0900
Xref x330-a1.tempe.blueboxinc.net comp.std.c++:286

Show key headers only | View raw


Daniel Krügler wrote:
>  Could you
>  please provide a more elaborate description how the current wording
>  state could be misinterpreted? If there exist a real-world example of
>  this misinterpretation, this would be even better.

There seems to be two different targets of the "up to n" modification:
The capacity of obtained buffer, and the actual number that the caller
will store into the buffer.

First I read as the latter, and got surprised seeing that libstdc++
implementation can return a smaller buffer. I started searching about
get_temporary_buffer(). After reading a quote from TC++PL at
stackoverflow, I realized that the former is intended.
http://stackoverflow.com/questions/3264299/why-do-i-need-stdget-temporary-buffer

Such misinterpretation seems common:
   - The above question is likely started from same misinterpretation.
   - JIS standard (Japanese translation of ISO/IEC standard) says nothing
     like "up to". I think the editor misinterpreted the original wording,
     and omitted words for "up to" as it is redundant. (If a buffer is
     sufficient to store n objects, it is also sufficient to store
     up to n objects.)
   - Rogue Wave implementation doesn't return smaller buffer, instead, it
     can return larger buffer on some circumstances.
     Apache STDCXX http://stdcxx.apache.org/ is a derived version of that
     implementation, and publicly accessible.
     http://svn.apache.org/viewvc/stdcxx/trunk/include/rw/_rawiter.h?view=markup&pathrev=1162883#l123
     http://svn.apache.org/viewvc/stdcxx/trunk/src/tmpbuf.cpp?view=markup&pathrev=1162883#l55
     http://stdcxx.apache.org/doc/stdlibref/get-temporary-buffer.html
     >  Specializations of the get_temporary_buffer() function template
     >  attempt to allocate a region of storage sufficiently large to store at
     >  least n adjacent objects of type T.
     I know one commercial compiler package based on Rogue Wave
     implementation, and its implementation is essentially same as the
     above.

>  It
>  is true, that the reader must somehow understand that the "capacity"
>  mentioned in p2 must refer to the more indirect requirement expressed by
>  "storage sufficient to store up to n adjacent T objects".

How a reader can understand such relation on the original wording? I
think some external information (like the quote from TC++PL) is required
to conclude as such.

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


Thread

Re: Defect Report: Unclear wording about capacity of temporary buffers Kazutoshi Satoda <k_satoda@f2.dion.ne.jp> - 2011-08-28 08:41 -0700
  Re: Defect Report: Unclear wording about capacity of temporary buffers Daniel Krügler<daniel.kruegler@googlemail.com> - 2011-08-28 11:07 -0700
  Re: Defect Report: Unclear wording about capacity of temporary buffers Kazutoshi Satoda<k_satoda@f2.dion.ne.jp> - 2011-09-11 09:12 -0700
    Re: Defect Report: Unclear wording about capacity of temporary buffers Daniel Krügler <daniel.kruegler@googlemail.com> - 2011-09-11 17:47 -0700

csiph-web