Return-Path: Delivered-To: apmail-stdcxx-issues-archive@locus.apache.org Received: (qmail 69133 invoked from network); 14 Oct 2008 10:38:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Oct 2008 10:38:05 -0000 Received: (qmail 65962 invoked by uid 500); 14 Oct 2008 10:38:06 -0000 Delivered-To: apmail-stdcxx-issues-archive@stdcxx.apache.org Received: (qmail 65941 invoked by uid 500); 14 Oct 2008 10:38:06 -0000 Mailing-List: contact issues-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list issues@stdcxx.apache.org Received: (qmail 65921 invoked by uid 99); 14 Oct 2008 10:38:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Oct 2008 03:38:06 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Oct 2008 10:37:07 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 47FB9234C224 for ; Tue, 14 Oct 2008 03:37:44 -0700 (PDT) Message-ID: <1316171720.1223980664293.JavaMail.jira@brutus> Date: Tue, 14 Oct 2008 03:37:44 -0700 (PDT) From: "Farid Zaripov (JIRA)" To: issues@stdcxx.apache.org Subject: [jira] Closed: (STDCXX-976) std::uninitialized_copy() requires InputIterator::operator*() returning lvalue In-Reply-To: <1318263860.1214563906020.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STDCXX-976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Farid Zaripov closed STDCXX-976. -------------------------------- > std::uninitialized_copy() requires InputIterator::operator*() returning lvalue > ------------------------------------------------------------------------------ > > Key: STDCXX-976 > URL: https://issues.apache.org/jira/browse/STDCXX-976 > Project: C++ Standard Library > Issue Type: Bug > Components: 25. Algorithms > Affects Versions: 4.2.0, 4.2.1 > Environment: All > Reporter: Farid Zaripov > Assignee: Farid Zaripov > Fix For: 4.2.2 > > Original Estimate: 1h > Remaining Estimate: 1h > > The following test fails to compile: > {code} > #include > #include > struct InputIterator: std::iterator > { > const char *p_; > InputIterator (const char *p): p_ (p) { } > InputIterator (const InputIterator &rhs): p_ (rhs.p_) { } > InputIterator& operator= (const InputIterator &rhs) > { p_ = rhs.p_; return *this; } > char operator* () const { return *p_; } > > InputIterator& operator++ () { return ++p_, *this; } > InputIterator operator++ (int) { > return ++p_, InputIterator (p_ - 1); > } > bool operator== (const InputIterator &rhs) const { return p_ == rhs.p_; } > bool operator!= (const InputIterator &rhs) const { return p_ != rhs.p_; } > }; > int main () > { > char src [5] = "abcd"; > char dst [5]; > std::uninitialized_copy (InputIterator (src), InputIterator (src + 5), dst); > return 0; > } > {code} > {noformat} > D:\_Libs\stdcxx-4.2.2\include\rw\_specialized.h(168) : error C2665: '__rw::__rw_construct' : none of the 2 overloads can convert parameter 2 from type 'char' > D:\_Libs\stdcxx-4.2.2\include\rw\_specialized.h(88): could be 'void __rw::__rw_construct(_TypeT *,_TypeU &)' > with > [ > _TypeT=char, > _TypeU=char > ] > D:\_Libs\stdcxx-4.2.2\include\rw\_specialized.h(96): or 'void __rw::__rw_construct(volatile _TypeT *,_TypeU &)' > with > [ > _TypeT=char, > _TypeU=char > ] > while trying to match the argument list '(char *, char)' > test.cpp(29) : see reference to function template instantiation '_ForwardIterator std::uninitialized_copy(_InputIterator,_InputIterator,_ForwardIterator)' being compiled > with > [ > _ForwardIterator=char *, > _InputIterator=InputIterator > ] > {noformat} > The fix: > {noformat} > Index: include/rw/_specialized.h > =================================================================== > --- include/rw/_specialized.h (revision 671890) > +++ include/rw/_specialized.h (working copy) > @@ -85,7 +85,7 @@ > > template > inline void > -__rw_construct (_TypeT* __p, _TypeU& __val) > +__rw_construct (_TypeT* __p, const _TypeU& __val) > { > ::new (_RWSTD_STATIC_CAST (void*, __p)) _TypeT (__val); > } > @@ -93,7 +93,7 @@ > > template > inline void > -__rw_construct (volatile _TypeT* __p, _TypeU& __val) > +__rw_construct (volatile _TypeT* __p, const _TypeU& __val) > { > // remove volatile before invoking operator new > __rw_construct (_RWSTD_CONST_CAST (_TypeT*, __p), __val); > @@ -103,7 +103,7 @@ > > template > inline void > -__rw_construct_impl (_TypeT* __p, _TypeU& __val) > +__rw_construct_impl (_TypeT* __p, const _TypeU& __val) > { > ::new (_RWSTD_STATIC_CAST (void*, __p)) _TypeT (__val); > } > @@ -111,7 +111,7 @@ > > template > inline void > -__rw_construct (volatile _TypeT* __p, _TypeU& __val) > +__rw_construct (volatile _TypeT* __p, const _TypeU& __val) > { > // remove volatile before invoking operator new > __rw_construct_impl (_RWSTD_CONST_CAST (_TypeT*, __p), __val); > {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.