public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/43813] [DR1234] vector<T*>(3, NULL) fails to compile Date: Sun, 04 Mar 2012 11:32:00 -0000 [thread overview] Message-ID: <bug-43813-4-FR4aW0sxlo@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-43813-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43813 Paolo Carlini <paolo.carlini at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.kruegler at | |googlemail dot com, | |jwakely.gcc at gmail dot | |com --- Comment #13 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-03-04 11:32:02 UTC --- Thus, since we do have indeed sfinae-friendly iterator-traits, I mean to consistently deply something like the below in all the relevant places. Even better ideas? Speak now or remain silent forever ;) Index: include/bits/stl_deque.h =================================================================== --- include/bits/stl_deque.h (revision 184879) +++ include/bits/stl_deque.h (working copy) @@ -888,6 +888,20 @@ * input iterators are used, then this will do at most 2N calls to the * copy constructor, and logN memory reallocations. */ +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template<typename _InputIterator, typename = typename + enable_if<is_convertible<typename + iterator_traits<_InputIterator>::iterator_category, + input_iterator_tag>::value>::type> + deque(_InputIterator __first, _InputIterator __last, + const allocator_type& __a = allocator_type()) + : _Base(__a) + { + typedef typename iterator_traits<_InputIterator>:: + iterator_category _IterCategory; + _M_range_initialize(__first, __last, _IterCategory()); + } +#else template<typename _InputIterator> deque(_InputIterator __first, _InputIterator __last, const allocator_type& __a = allocator_type()) @@ -897,6 +911,7 @@ typedef typename std::__is_integer<_InputIterator>::__type _Integral; _M_initialize_dispatch(__first, __last, _Integral()); } +#endif /** * The dtor only erases the elements, and note that if the elements
next prev parent reply other threads:[~2012-03-04 11:32 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-43813-4@http.gcc.gnu.org/bugzilla/> 2011-10-28 10:00 ` marc.glisse at normalesup dot org 2012-02-23 1:02 ` jyasskin at gcc dot gnu.org 2012-02-23 11:37 ` paolo.carlini at oracle dot com 2012-02-23 12:47 ` paolo.carlini at oracle dot com 2012-03-04 11:32 ` paolo.carlini at oracle dot com [this message] 2012-03-04 11:39 ` paolo.carlini at oracle dot com 2012-03-04 12:02 ` redi at gcc dot gnu.org 2012-03-04 12:59 ` paolo.carlini at oracle dot com 2012-03-04 13:07 ` redi at gcc dot gnu.org 2012-03-05 1:16 ` paolo at gcc dot gnu.org 2012-03-05 1:18 ` paolo.carlini at oracle dot com 2012-03-07 18:44 ` redi at gcc dot gnu.org 2010-04-20 7:07 [Bug libstdc++/43813] New: " jyasskin at gmail dot com 2010-04-20 9:40 ` [Bug libstdc++/43813] [DR1234] " redi at gcc dot gnu dot org 2010-04-20 9:41 ` redi at gcc dot gnu dot org 2010-04-20 16:11 ` paolo dot carlini at oracle dot com 2010-04-20 16:36 ` jyasskin at gmail dot com 2010-04-20 16:50 ` redi at gcc dot gnu dot org 2010-04-20 17:00 ` redi at gcc dot gnu dot org 2010-04-20 20:04 ` jyasskin at gmail dot com 2010-04-21 0:33 ` paolo dot carlini at oracle dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-43813-4-FR4aW0sxlo@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).