Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 21068 invoked from network); 7 Jan 2006 20:57:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Jan 2006 20:57:08 -0000 Received: (qmail 31458 invoked by uid 500); 7 Jan 2006 20:57:08 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 31445 invoked by uid 500); 7 Jan 2006 20:57:07 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 31434 invoked by uid 99); 7 Jan 2006 20:57:07 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jan 2006 12:57:05 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 036AF1A9 for ; Sat, 7 Jan 2006 21:56:44 +0100 (CET) Message-ID: <379496658.1136667404011.JavaMail.jira@ajax.apache.org> Date: Sat, 7 Jan 2006 21:56:44 +0100 (CET) From: "Martin Sebor (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Closed: (STDCXX-84) std::fill_n() assumes Size can be decremented In-Reply-To: <959435021.1133992628922.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/STDCXX-84?page=all ] Martin Sebor closed STDCXX-84: ------------------------------ Test 25.fill.cpp enhanced with the following change: http://svn.apache.org/viewcvs.cgi?rev=357264&view=rev Closing. > std::fill_n() assumes Size can be decremented > --------------------------------------------- > > Key: STDCXX-84 > URL: http://issues.apache.org/jira/browse/STDCXX-84 > Project: STDCXX > Type: Bug > Components: 25. Algorithms > Versions: 4.1.2 > Environment: all > Reporter: Martin Sebor > Assignee: Martin Sebor > Priority: Minor > Fix For: 4.1.3 > > The requirement on the Size template argument to std::fill_n() in lib.alg.fill, p3 is that it be convertible to an integral type which does not imply that it be possible to decrement or otherwise modify its value. I.e., the program below is expected to compile successfully. > $ cat t.cpp && nice make t > #include > struct Size { > operator int() { return 0; } > private: > void operator=(Size&); > }; > template void std::fill_n (int*, Size, const int&); > int main () { } > eccp -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/eccp-3.6-11s/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/../rwtest -I/build/sebor/dev/stdlib/../rwtest/include -I/build/sebor/dev/stdlib/tests/include -A -x --template_directory=/build/sebor/eccp-3.6-11s/lib -g --display_error_number --remarks --diag_suppress 193,236,340,401,261,479,487,678,679,815 t.cpp > "/build/sebor/dev/stdlib/include/rw/_algobase.h", line 132: error #349: no > operator "--" matches these operands > operand types are: -- Size > for (;__n > 0;--__n, ++__first) > ^ > detected during instantiation of "void std::fill_n(_OutputIter, > _Size, const _TypeT &) [with _OutputIter=int *, > _Size=Size, _TypeT=int]" at line 9 of "t.cpp" > 1 error detected in the compilation of "t.cpp". > make: *** [t.o] Error 2 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira