Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 56789 invoked from network); 28 Mar 2007 00:03:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Mar 2007 00:03:53 -0000 Received: (qmail 55685 invoked by uid 500); 28 Mar 2007 00:04:00 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 55669 invoked by uid 500); 28 Mar 2007 00:04:00 -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 55658 invoked by uid 99); 28 Mar 2007 00:04:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2007 17:04:00 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2007 17:03:52 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2F4BD714063 for ; Tue, 27 Mar 2007 17:03:32 -0700 (PDT) Message-ID: <846122.1175040212164.JavaMail.jira@brutus> Date: Tue, 27 Mar 2007 17:03:32 -0700 (PDT) From: "Martin Sebor (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Commented: (STDCXX-292) std::string::assign(0, size, value) ambiguous In-Reply-To: <8206368.1159815019965.JavaMail.root@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-292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484655 ] Martin Sebor commented on STDCXX-292: ------------------------------------- This is a "known" issue with the basic_string interface (see post c++std-lib-17449 to the C++ committee's reflector). It might (should) be possible to handle it by placing a suitable constraint (along the lines of "enable_if>") on the template, and according to the C++ committee it should be dealt with by the introduction of C++ Concepts into the language (see post c++std-lib-17450). We might want to implement the enable_if trick until concepts is widely available. > std::string::assign(0, size, value) ambiguous > --------------------------------------------- > > Key: STDCXX-292 > URL: https://issues.apache.org/jira/browse/STDCXX-292 > Project: C++ Standard Library > Issue Type: Bug > Components: 21. Strings > Affects Versions: 4.1.3, 4.1.2 > Environment: all > Reporter: Martin Sebor > Priority: Minor > > From http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-dev/200609.mbox/%3c451C1D61.1030807@roguewave.com%3e: > This fails to compile without debugging iterators: > #include > int main () > { > std::string s; > unsigned n = 3; > s.insert (0, n, 'x'); > } > $ make t > gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-8s/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -O2 -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long t.cpp > t.cpp: In function 'int main()': > t.cpp:7: error: call of overloaded 'insert(int, unsigned int&, char)' is ambiguous > /build/sebor/dev/stdlib/include/string:520: note: candidates are: void std::basic_string<_CharT, _Traits, _Allocator>::insert(typename _Allocator::pointer, typename _Allocator::size_type, typename _Traits::char_type) [with _CharT = char, _Traits = std::char_traits, _Allocator = std::allocator] > /build/sebor/dev/stdlib/include/string:525: note: std::basic_string<_CharT, _Traits, _Allocator>& std::basic_string<_CharT, _Traits, _Allocator>::insert(typename _Allocator::size_type, typename _Allocator::size_type, typename _Traits::char_type) [with _CharT = char, _Traits = std::char_traits, _Allocator = std::allocator] > make: *** [t.o] Error 1 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.