public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hyounes at google dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/44436] [C++0x] Implement emplace* in associative and unordered containers
Date: Thu, 09 Jun 2011 13:03:00 -0000	[thread overview]
Message-ID: <bug-44436-4-BK6UfP5Kle@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-44436-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #26 from Haakan Younes <hyounes at google dot com> 2011-06-09 13:03:19 UTC ---
(In reply to comment #18)
> (In reply to comment #15)
> > Is it really so hard to code emplace methods? Can we somehow help?
> 
> It's not so hard, but we have limited resources and other priorities.
> 
> Patches welcome, see
> http://gcc.gnu.org/onlinedocs/libstdc++/manual/appendix_contributing.html

I started looking into it about a year ago, before you added insert(&&).  It
seems easy enough to add emplace for map, but what about set?

For map, the first argument to emplace is going to be the key (I believe).  We
can therefore determine if the key is already present in the map before we
construct the value object from the remaining arguments to emplace.

For set, the key is the value, so I don't see a way to avoid constructing the
value object from the arguments to emplace before you know if it should be
inserted.

Am I thinking about it the wrong way?

BTW, I have been happily using insert(&&) for maps for at least 6 months (GCC
built from trunk).  I strongly suspect it is available with GCC 4.6.  You
definitely do not need emplace to store unique_ptr values in a map.


  parent reply	other threads:[~2011-06-09 13:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-44436-4@http.gcc.gnu.org/bugzilla/>
2010-10-23 15:29 ` [Bug libstdc++/44436] [C++0x] Implement insert(&&) and " redi at gcc dot gnu.org
2010-10-23 16:01 ` paolo.carlini at oracle dot com
2010-10-26 12:18 ` paolo.carlini at oracle dot com
2010-10-26 12:28 ` redi at gcc dot gnu.org
2010-10-26 12:31 ` paolo.carlini at oracle dot com
2010-10-26 12:40 ` redi at gcc dot gnu.org
2010-10-28 16:01 ` paolo at gcc dot gnu.org
2010-11-10 19:09 ` paolo at gcc dot gnu.org
2010-12-10 16:56 ` [Bug libstdc++/44436] [C++0x] Implement " paolo.carlini at oracle dot com
2011-06-09 11:23 ` Kira.Backes at NRWsoft dot de
2011-06-09 11:31 ` paolo.carlini at oracle dot com
2011-06-09 11:47 ` paolo.carlini at oracle dot com
2011-06-09 11:52 ` redi at gcc dot gnu.org
2011-06-09 12:00 ` Kira.Backes at NRWsoft dot de
2011-06-09 12:08 ` paolo.carlini at oracle dot com
2011-06-09 12:21 ` Kira.Backes at NRWsoft dot de
2011-06-09 12:25 ` redi at gcc dot gnu.org
2011-06-09 12:27 ` Kira.Backes at NRWsoft dot de
2011-06-09 12:35 ` redi at gcc dot gnu.org
2011-06-09 12:42 ` Kira.Backes at NRWsoft dot de
2011-06-09 13:03 ` hyounes at google dot com [this message]
2011-06-09 13:14 ` redi at gcc dot gnu.org
2011-06-09 13:28 ` redi at gcc dot gnu.org
2011-11-05 20:39 ` zeratul976 at hotmail dot com
2011-11-06  0:30 ` redi at gcc dot gnu.org
2011-12-11 10:33 ` [Bug libstdc++/44436] [C++0x] Implement emplace* in associative containers paolo.carlini at oracle dot com
2012-09-24 19:54 ` fdumont at gcc dot gnu.org
2012-09-25  8:44 ` paolo at gcc dot gnu.org
2012-09-25  8:47 ` paolo.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-44436-4-BK6UfP5Kle@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).