Topic: Are call wrappers move-enabled?


Author: Scott Meyers <usenet@aristeia.com>
Date: Tue, 17 Nov 2009 10:27:50 CST
Raw View
[func.require]/4 (20.7.2/4 in N3000) says that call wrappers (such as are
returned from std::bind) must be copy constructible, but it says nothing about
such wrappers being movable.  Does this mean that in

   auto f = std::bind( /* blah, blah, blah */ );

I should expect f to be copy constructed from the object returned by bind?

Thanks,

Scott

--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@googlemail.com>
Date: Tue, 17 Nov 2009 13:29:11 CST
Raw View
On 17 Nov., 17:27, Scott Meyers <use...@aristeia.com> wrote:
> [func.require]/4 (20.7.2/4 in N3000) says that call wrappers (such as are
> returned from std::bind) must be copy constructible, but it says nothing about
> such wrappers being movable.  Does this mean that in
>
>    auto f = std::bind( /* blah, blah, blah */ );
>
> I should expect f to be copy constructed from the object returned by bind?

No, the result should be movable. Note that this LWG issue:

http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#817

HTH & Geetings from Bremen,

Daniel Kr   gler


--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]