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++/59969] std::pair nonstandard constructor interferes when calling map::emplace with noncopyable nonmovable object
Date: Wed, 08 Apr 2015 16:10:00 -0000 [thread overview]
Message-ID: <bug-59969-4-3Gju0l6qeS@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59969-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59969
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The attached example builds fine, I think you mean this:
#include <map>
struct A
{
int bla;
A(int blub):bla(blub){}
A(A&&) = delete;
A(const A&) = delete;
A& operator=(A&&) = delete;
A& operator=(const A&) = delete;
};
int main()
{
std::map<int, A> map;
map.emplace(1, 1);
}
That code isn't valid.
(In reply to gcc.gnu.org.49489419 from comment #0)
> is preferred over the standard constructor
>
> template<class _U1, class _U2,
> class = typename enable_if<__and_<is_convertible<_U1, _T1>,
> is_convertible<_U2, _T2>
> >::value
> >::type>
> constexpr pair(_U1&& __x, _U2&& __y)
> : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
That constructor isn't valid because is_convertible<int, A> is false, because
is_convertible is always false for non-movable types.
next prev parent reply other threads:[~2015-04-08 16:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 14:43 [Bug libstdc++/59969] New: " gcc.gnu.org.49489419@oli-obk.de
2015-04-08 16:10 ` redi at gcc dot gnu.org [this message]
2015-04-08 16:16 ` [Bug libstdc++/59969] " 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-59969-4-3Gju0l6qeS@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).