Brought thread variadic constructor up to current spec, which allows move-only functors and move-only arguments, but disallows functors with non-const lvalue reference parameters.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131413 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2011-05-16 18:40:35 +00:00
parent ed22f562e5
commit 656bdc3667
3 changed files with 69 additions and 19 deletions

View File

@@ -71,6 +71,22 @@ public:
int G::n_alive = 0;
bool G::op_run = false;
#ifndef _LIBCPP_HAS_NO_VARIADICS
class MoveOnly
{
MoveOnly(const MoveOnly&);
public:
MoveOnly() {}
MoveOnly(MoveOnly&&) {}
void operator()(MoveOnly&&)
{
}
};
#endif
int main()
{
{
@@ -126,5 +142,9 @@ int main()
assert(G::n_alive == 0);
assert(G::op_run);
}
{
std::thread t = std::thread(MoveOnly(), MoveOnly());
t.join();
}
#endif // _LIBCPP_HAS_NO_VARIADICS
}