public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs
@ 2010-10-05 11:05 paolo.carlini at oracle dot com
  2010-10-05 11:06 ` [Bug libstdc++/45893] [C++0x] " paolo.carlini at oracle dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-10-05 11:05 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Finish updating std::bind to rvalue refs
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: paolo.carlini@oracle.com


While working on something else, I just noticed that, eg, we still have
bind(_Functor __f, _ArgTypes... __args) instead of bind(_Functor&& __f,
_ArgTypes&&... __args).


I also wonder if this may have to do with the mysterious issues with volatile
and const volatile (for example, thread takes && but then uses bind which
doesn't...)


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
@ 2010-10-05 11:06 ` paolo.carlini at oracle dot com
  2010-10-05 11:14 ` redi at gcc dot gnu.org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-10-05 11:06 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Finish updating std::bind   |[C++0x] Finish updating
                   |to rvalue refs              |std::bind to rvalue refs
           Severity|normal                      |enhancement


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
  2010-10-05 11:06 ` [Bug libstdc++/45893] [C++0x] " paolo.carlini at oracle dot com
@ 2010-10-05 11:14 ` redi at gcc dot gnu.org
  2010-10-05 13:27 ` [Bug libstdc++/45893] [C++0x] [DR 817] " paolo.carlini at oracle dot com
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2010-10-05 11:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-05 11:14:53 UTC ---
ah yes that was DR 817 - I don't *think* it's related to the volatile problems,
but I would be happy to be wrong!


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
  2010-10-05 11:06 ` [Bug libstdc++/45893] [C++0x] " paolo.carlini at oracle dot com
  2010-10-05 11:14 ` redi at gcc dot gnu.org
@ 2010-10-05 13:27 ` paolo.carlini at oracle dot com
  2010-10-06  1:00 ` paolo.carlini at oracle dot com
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-10-05 13:27 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[C++0x] Finish updating     |[C++0x] [DR 817] Finish
                   |std::bind to rvalue refs    |updating std::bind to
                   |                            |rvalue refs

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-10-05 13:27:18 UTC ---
I see. By the way, when std::bind is fixed, it should become possible to remove
the thread::thread(_Callable) constructor (alternately, we should not use there
std::bind as an implementation detail).


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
                   ` (2 preceding siblings ...)
  2010-10-05 13:27 ` [Bug libstdc++/45893] [C++0x] [DR 817] " paolo.carlini at oracle dot com
@ 2010-10-06  1:00 ` paolo.carlini at oracle dot com
  2010-10-06  1:13 ` paolo.carlini at oracle dot com
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-10-06  1:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-10-06 01:00:27 UTC ---
In fact, if I enable again the volatile and const volatile overloads *and*
fiddle a bit (incompletely) with bind(_Functor __f, _ArgTypes... __args)
changing it to bind(_Functor __f, _ArgTypes&&... __args) and also with
thread(_Callable&& __f, _Args&&... __args) to forward the __args to bind, the
packaged_task/members/invoke5.cc regression caused by the former overloads goes
away. Thus there are definitely interactionss between these issues.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
                   ` (3 preceding siblings ...)
  2010-10-06  1:00 ` paolo.carlini at oracle dot com
@ 2010-10-06  1:13 ` paolo.carlini at oracle dot com
  2010-10-06  8:34 ` redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-10-06  1:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-10-06 01:13:27 UTC ---
Jon, can I have your help, here?

I'm pretty sure that fixing / implementing this (+ properly forwarding from the
30_threads facilities using bind) would also allow enabling the commented out
overloads for volatile and const volatile. A huge win everywhere.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
                   ` (4 preceding siblings ...)
  2010-10-06  1:13 ` paolo.carlini at oracle dot com
@ 2010-10-06  8:34 ` redi at gcc dot gnu.org
  2010-10-07  0:46 ` redi at gcc dot gnu.org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2010-10-06  8:34 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2010.10.06 08:33:51
                 CC|jwakely.gcc at gmail dot    |
                   |com                         |
         AssignedTo|unassigned at gcc dot       |redi at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.6.0
     Ever Confirmed|0                           |1

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-06 08:33:51 UTC ---
I'll work on this tonight, I'm already working in <future> for allocator
support.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
                   ` (5 preceding siblings ...)
  2010-10-06  8:34 ` redi at gcc dot gnu.org
@ 2010-10-07  0:46 ` redi at gcc dot gnu.org
  2010-10-07  1:24 ` paolo.carlini at oracle dot com
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2010-10-07  0:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-07 00:46:26 UTC ---
The _Bind and _Bind_result ctors need to be made into templates so that they
can deduce the arguments as either lvalue or rvalue references, allowing
_Bound_args elements to be move-constructed if an rvalue is passed to
std::bind.  Two template ctors are needed, for the case where the first
argument is an lvalue or an rvalue.

I added a copy ctor and move ctor, allowing _Bind and _Bind_result objects to
be moved

The new _Bind_helper and _Bindres_helper templates are simply to avoid
repeating typename _Maybe_wrap_member_pointer<typename
decay<_Functor>::type>::type in the return type and body of std::bind.

The call_once patch is for DR891, but is related to this PR because we use
std::bind to implement call_once.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
                   ` (6 preceding siblings ...)
  2010-10-07  0:46 ` redi at gcc dot gnu.org
@ 2010-10-07  1:24 ` paolo.carlini at oracle dot com
  2010-10-07  1:38 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-10-07  1:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-10-07 01:24:04 UTC ---
Great progress ;)


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
                   ` (7 preceding siblings ...)
  2010-10-07  1:24 ` paolo.carlini at oracle dot com
@ 2010-10-07  1:38 ` paolo.carlini at oracle dot com
  2010-10-07  1:39 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-10-07  1:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-10-07 01:38:31 UTC ---
PS: I don't know if this can help you with your work, but today I wondered
whether we should put to good use forward_as_tuple where we used to have tie
and elsewhere too. Without having seriously analyzed the situation seems
strange that things like:

        operator()(_Args&&... __args)
        {
          return this->__call<_Result>(tuple<_Args...>
                       (std::forward<_Args>(__args)...),
 can't be

        operator()(_Args&&... __args)
        {
          return this->__call<_Result>(forward_as_tuple(__args...),

or something like that... may need adjustments where tuple<_Args...> is now
expected, tough.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
                   ` (8 preceding siblings ...)
  2010-10-07  1:38 ` paolo.carlini at oracle dot com
@ 2010-10-07  1:39 ` paolo.carlini at oracle dot com
  2010-10-07  1:41 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-10-07  1:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-10-07 01:39:33 UTC ---
Super mega yeah!!!


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
                   ` (9 preceding siblings ...)
  2010-10-07  1:39 ` paolo.carlini at oracle dot com
@ 2010-10-07  1:41 ` redi at gcc dot gnu.org
  2010-10-08  0:44 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2010-10-07  1:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-07 01:41:40 UTC ---
(In reply to comment #13)
> PS: I don't know if this can help you with your work, but today I wondered
> whether we should put to good use forward_as_tuple where we used to have tie
> and elsewhere too.

Good idea, I forgot we have that now.

I'll try to get a complete patch, including that idea, tomorrow.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
                   ` (11 preceding siblings ...)
  2010-10-08  0:44 ` redi at gcc dot gnu.org
@ 2010-10-08  0:44 ` redi at gcc dot gnu.org
  2010-10-08  9:26 ` paolo.carlini at oracle dot com
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2010-10-08  0:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-08 00:44:15 UTC ---
Author: redi
Date: Fri Oct  8 00:44:12 2010
New Revision: 165144

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165144
Log:
2010-10-08  Jonathan Wakely  <jwakely.gcc@gmail.com>

    PR libstdc++/45893
    * include/std/functional (bind): Implement DR 817 and add support
    for volatile-qualified call wrappers.
    * include/std/mutex (call_once): Implement DR 891.
    * include/std/thread (thread::thread): Implement DR 929.
    * include/std/future: Optimise use of std::bind.
    * testsuite/20_util/bind/cv_quals.cc: Test volatile-qualification.
    * testsuite/20_util/bind/move.cc: New.

Added:
    trunk/libstdc++-v3/testsuite/20_util/bind/move.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/std/functional
    trunk/libstdc++-v3/include/std/future
    trunk/libstdc++-v3/include/std/mutex
    trunk/libstdc++-v3/include/std/thread
    trunk/libstdc++-v3/testsuite/20_util/bind/cv_quals.cc


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
                   ` (10 preceding siblings ...)
  2010-10-07  1:41 ` redi at gcc dot gnu.org
@ 2010-10-08  0:44 ` redi at gcc dot gnu.org
  2010-10-08  0:44 ` redi at gcc dot gnu.org
  2010-10-08  9:26 ` paolo.carlini at oracle dot com
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2010-10-08  0:44 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #17 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-08 00:44:49 UTC ---
Fixed!


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
  2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
                   ` (12 preceding siblings ...)
  2010-10-08  0:44 ` redi at gcc dot gnu.org
@ 2010-10-08  9:26 ` paolo.carlini at oracle dot com
  13 siblings, 0 replies; 15+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-10-08  9:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-10-08 09:26:17 UTC ---
Excellent. Thanks a lot again Jon!


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-10-08  9:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-05 11:05 [Bug libstdc++/45893] New: Finish updating std::bind to rvalue refs paolo.carlini at oracle dot com
2010-10-05 11:06 ` [Bug libstdc++/45893] [C++0x] " paolo.carlini at oracle dot com
2010-10-05 11:14 ` redi at gcc dot gnu.org
2010-10-05 13:27 ` [Bug libstdc++/45893] [C++0x] [DR 817] " paolo.carlini at oracle dot com
2010-10-06  1:00 ` paolo.carlini at oracle dot com
2010-10-06  1:13 ` paolo.carlini at oracle dot com
2010-10-06  8:34 ` redi at gcc dot gnu.org
2010-10-07  0:46 ` redi at gcc dot gnu.org
2010-10-07  1:24 ` paolo.carlini at oracle dot com
2010-10-07  1:38 ` paolo.carlini at oracle dot com
2010-10-07  1:39 ` paolo.carlini at oracle dot com
2010-10-07  1:41 ` redi at gcc dot gnu.org
2010-10-08  0:44 ` redi at gcc dot gnu.org
2010-10-08  0:44 ` redi at gcc dot gnu.org
2010-10-08  9:26 ` paolo.carlini at oracle dot com

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).