public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "widman at gimpel dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/32658] Supposedly illegal conversion compiles without errors
Date: Thu, 02 Aug 2007 17:07:00 -0000	[thread overview]
Message-ID: <20070802170732.30066.qmail@sourceware.org> (raw)
In-Reply-To: <bug-32658-11053@http.gcc.gnu.org/bugzilla/>



------- Comment #8 from widman at gimpel dot com  2007-08-02 17:07 -------
(In reply to comment #7)
> (In reply to comment #6) 
> > Is it possible that rvalue references will give you an alternative for the
> > desired effect?  See the relevant papers linked to from here:
> > 
> > http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2291.html
> > 
> 
> This would mean that instead of A::A(A &), I wrote A::A(A &&) and passing
> temporaries would automatically work?

That's correct.  Rvalues  would bind directly to the 'A&&' parameter; you could
even have two ctors:
struct A {
 A(const A&);   // copy ctor
 A(A&&);          // move ctor
};
...and when you initialize an 'A' with an rvalue, overload resolution will
select the move ctor.


-- 


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


  parent reply	other threads:[~2007-08-02 17:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-06 21:43 [Bug c++/32658] New: " aribrei at arcor dot de
2007-07-06 21:44 ` [Bug c++/32658] " aribrei at arcor dot de
2007-07-07  0:00 ` pinskia at gcc dot gnu dot org
2007-07-07  1:46 ` aribrei at arcor dot de
2007-07-09 12:39 ` aribrei at arcor dot de
2007-08-01 19:42 ` nathan at gcc dot gnu dot org
2007-08-02 15:56 ` widman at gimpel dot com
2007-08-02 16:35 ` aribrei at arcor dot de
2007-08-02 17:07 ` widman at gimpel dot com [this message]
2007-08-02 17:17 ` widman at gimpel dot com
2007-08-02 18:39 ` aribrei at arcor dot de
     [not found] <bug-32658-4@http.gcc.gnu.org/bugzilla/>
2012-08-22 20:56 ` 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=20070802170732.30066.qmail@sourceware.org \
    --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).