public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/55043] [4.7/4.8 Regression] issue with nesting unordered_map containing unique_ptr into vector
Date: Wed, 24 Oct 2012 15:40:00 -0000	[thread overview]
Message-ID: <bug-55043-4-A8Y7ZglkbC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55043-4@http.gcc.gnu.org/bugzilla/>


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55043

--- Comment #15 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-24 15:40:28 UTC ---
(In reply to comment #14)

> I think it is implementable (I have done something similar to ensure that my
> optional<T> realizes the same effect), but the costs are not small:
> 
> 1) It will prevent the incomplete type support

Ouch... but not required by the standard.

> 2) The implementation changes are not small (my guess)

Apart from the changes to allocator_traits and defining CopyInsertable etc.
(which I think isn't so hard, I can do that tonight) IIUC it would require
changing every container so that e.g.

    vector<T,A>::vector(const vector&)

becomes

    template<typename U>
      vector<T,A>::vector(const vector<U,A>&)

with constraints is_same<T,U> and CopyInsertable<A,T>, because we can't
constrain that constructor if it's not a template

Is that even allowed under the as-if rule?

Do we really want to go there?

Is there some other way to make examples like this compile?

  #include <vector>

  struct M
  {
    M() = default;
    M(M&&) = default;
    M& operator=(M&&) = default;
  };

  typedef std::vector<M> S;

  static_assert( !std::is_copy_constructible<S>::value,
                 "not CopyConstructible" );


  parent reply	other threads:[~2012-10-24 15:40 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 21:17 [Bug libstdc++/55043] New: " boris.bigott at hotmail dot com
2012-10-23 21:35 ` [Bug libstdc++/55043] " redi at gcc dot gnu.org
2012-10-23 22:29 ` redi at gcc dot gnu.org
2012-10-23 22:35 ` [Bug libstdc++/55043] [4.7/4.8 Regression] " redi at gcc dot gnu.org
2012-10-23 22:53 ` paolo.carlini at oracle dot com
2012-10-23 23:06 ` redi at gcc dot gnu.org
2012-10-23 23:14 ` paolo.carlini at oracle dot com
2012-10-24  1:08 ` redi at gcc dot gnu.org
2012-10-24  1:24 ` redi at gcc dot gnu.org
2012-10-24  3:04 ` glisse at gcc dot gnu.org
2012-10-24  6:37 ` daniel.kruegler at googlemail dot com
2012-10-24  8:25 ` redi at gcc dot gnu.org
2012-10-24  8:34 ` daniel.kruegler at googlemail dot com
2012-10-24  9:10 ` redi at gcc dot gnu.org
2012-10-24  9:23 ` daniel.kruegler at googlemail dot com
2012-10-24 15:40 ` redi at gcc dot gnu.org [this message]
2012-10-24 17:37 ` redi at gcc dot gnu.org
2012-10-24 17:48 ` daniel.kruegler at googlemail dot com
2012-10-24 18:12 ` daniel.kruegler at googlemail dot com
2012-10-24 18:51 ` paolo.carlini at oracle dot com
2012-10-24 20:04 ` redi at gcc dot gnu.org
2012-10-24 20:29 ` paolo.carlini at oracle dot com
2012-11-25 15:58 ` rguenth at gcc dot gnu.org
2012-12-06 16:07 ` rguenth at gcc dot gnu.org
2013-01-16  9:21 ` redi at gcc dot gnu.org
2013-01-16  9:26 ` [Bug libstdc++/55043] [4.7 " redi at gcc dot gnu.org
2013-01-16  9:39 ` glisse at gcc dot gnu.org
2013-01-16  9:43 ` daniel.kruegler at googlemail dot com
2013-01-16 10:26 ` redi at gcc dot gnu.org
2013-01-16 10:53 ` redi at gcc dot gnu.org
2013-01-16 23:56 ` redi at gcc dot gnu.org
2013-01-16 23:58 ` redi at gcc dot gnu.org
2013-02-20 23:56 ` redi at gcc dot gnu.org
2013-02-20 23:57 ` redi at gcc dot gnu.org

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-55043-4-A8Y7ZglkbC@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: link
Be 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).