gcc/libstdc++-v3/include/std/future

1757 lines
50 KiB
Plaintext
Raw Normal View History

future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// <future> -*- C++ -*-
// Copyright (C) 2009-2016 Free Software Foundation, Inc.
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file include/future
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
* This is a Standard C++ Library header.
*/
#ifndef _GLIBCXX_FUTURE
#define _GLIBCXX_FUTURE 1
#pragma GCC system_header
#if __cplusplus < 201103L
hashtable.h: Fold in include/tr1_impl/hashtable.h contents. 2010-02-10 Paolo Carlini <paolo.carlini@oracle.com> * include/tr1/hashtable.h: Fold in include/tr1_impl/hashtable.h contents. * include/tr1_impl/hashtable.h: Remove. * include/tr1_impl/hashtable_policy.h: Move and rename... * include/tr1/hashtable_policy.h: ... here. * include/tr1_impl/unordered_map: Move and rename... * include/tr1/unordered_map.h: ... here. * include/tr1_impl/unordered_set: Move and rename... * include/tr1/unordered_set.h: ... here. * include/tr1_impl/unordered_map: Move and rename... * include/tr1/unordered_map.h: ... here. * include/tr1/unordered_map: Adjust. * include/tr1/unordered_set: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * include/std/c++0x_warning.h: Move... * include/bits/c++0x_warning.h: ... here. * include/debug/unordered_map: Adjust. * include/debug/unordered_set: Likewise. * include/std/tuple: Likewise. * include/std/system_error: Likewise. * include/std/forward_list: Likewise. * include/std/thread: Likewise. * include/std/type_traits: Likewise. * include/std/future: Likewise. * include/std/regex: Likewise. * include/std/atomic: Likewise. * include/std/ratio: Likewise. * include/std/random: Likewise. * include/std/unordered_map: Likewise. * include/std/chrono: Likewise.: Likewise. * include/std/condition_variable: Likewise. * include/std/mutex: Likewise. * include/std/unordered_set: Likewise. * include/std/array: Likewise. * include/profile/unordered_map: Likewise. * include/profile/unordered_set: Likewise. * include/c_global/cinttypes: Likewise. * include/c_global/ctgmath: Likewise. * include/c_global/cfenv: Likewise. * include/c_global/cstdint: Likewise. * include/c_global/cstdbool: Likewise. * include/c_global/ccomplex: Likewise. * include/bits/shared_ptr.h: Do not include <bits/c++0x_warning.h> at all, the file is not meant to be included by the users. * include/bits/functional_hash.h: Likewise. * include/bits/unique_ptr.h: Likewise. * include/bits/forward_list.h: Likewise. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-* line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Likewise. * testsuite/20_util/unique_ptr/assign/assign_neg.cc: Likewise. From-SVN: r156667
2010-02-10 20:14:33 +01:00
# include <bits/c++0x_warning.h>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
#else
#include <functional>
#include <mutex>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
#include <thread>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
#include <condition_variable>
#include <system_error>
atomic: Update to N3000. 2009-12-20 Benjamin Kosnik <bkoz@redhat.com> * include/std/atomic: Update to N3000. * include/bits/atomic_0.h: Same. * include/bits/atomic_2.h: Same. * include/c_global/cstdatomic: Move... * include/bits/atomic_base.h: ...here. * include/c_compatibility/stdatomic.h: Just include atomic_base.h. * include/precompiled/stdc++.h: Adjust includes. * include/Makefile.am: Adjust files. * include/Makefile.in: Regenerate. * include/std/future: Adjust. * src/atomic.cc: Adjust, adjust exports for compatibility. * src/compatibility.cc: Move C++0x stuff... * src/compatibility-c++0x.cc: ...here. * doc/xml/manual/using.xml: Update. * doc/xml/manual/status_cxx200x.xml: Update. * doc/doxygen/user.cfg.in: Update. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/single_value.cc: Same. * testsuite/29_atomics/atomic_address/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/default.cc: Same. * testsuite/29_atomics/atomic_address/cons/aggregate.cc: Same. * testsuite/29_atomics/atomic_address/requirements/ standard_layout.cc: Same. * testsuite/29_atomics/atomic_address/requirements/trivial.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/single_value.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/default.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_list.cc: Same. * testsuite/29_atomics/atomic_integral/cons/direct_list.cc: Same. * testsuite/29_atomics/atomic_integral/requirements/ standard_layout.cc: Same. * testsuite/29_atomics/atomic_integral/requirements/trivial.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/ integral_assignment.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement.cc: Same. * testsuite/29_atomics/atomic_integral/operators/ integral_conversion.cc: Same. * testsuite/29_atomics/atomic_flag/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/default.cc: Same. * testsuite/29_atomics/atomic_flag/cons/aggregate.cc: Same. * testsuite/29_atomics/atomic_flag/requirements/ standard_layout.cc: Same. * testsuite/29_atomics/atomic_flag/requirements/trivial.cc: Same. * testsuite/29_atomics/atomic_flag/clear/1.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c * testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c * testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/single_value.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/default.cc: Same. * testsuite/29_atomics/atomic/cons/copy_list.cc: Same. * testsuite/29_atomics/atomic/cons/direct_list.cc: Same. * testsuite/29_atomics/atomic/requirements/explicit_instantiation/ 1.cc: Same. * testsuite/29_atomics/atomic/requirements/base_classes.cc: Same. * testsuite/29_atomics/atomic/operators/integral_assignment.cc: Same. * testsuite/29_atomics/atomic/operators/integral_conversion.cc: Same. * testsuite/util/testsuite_common_types.h: Adjust. * testsuite/29_atomics/headers/cstdatomic: Move and adjust... * testsuite/29_atomics/headers/atomic: ...here. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/functions_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/std_c++0x_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Add. * testsuite/29_atomics/atomic/cons/user_pod.cc: Add. From-SVN: r155377
2009-12-21 20:00:34 +01:00
#include <atomic>
#include <bits/atomic_futex.h>
#include <bits/functexcept.h>
#include <bits/unique_ptr.h>
#include <bits/shared_ptr.h>
#include <bits/uses_allocator.h>
#include <bits/allocated_ptr.h>
#include <ext/aligned_buffer.h>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
cinttypes: Remove, move contents to C++0x and TR1 headers. 2010-11-02 Paolo Carlini <paolo.carlini@oracle.com> * include/tr1_impl/cinttypes: Remove, move contents to C++0x and TR1 headers. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/boost_sp_counted_base.h: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. * src/condition_variable.cc: Adjust; consistently use _GLIBCXX_BEGIN_NAMESPACE and _GLIBCXX_END_NAMESPACE. * src/mutex.cc: Likewise. * src/future.cc: Likewise. * src/atomic.cc: Likewise. * src/chrono.cc: Likewise. * src/thread.cc: Likewise. * include/std/tuple: Likewise. * include/std/utility: Likewise. * include/std/thread: Likewise.: Likewise. * include/std/type_traits: Likewise. * include/std/memory: Likewise. * include/std/future: Likewise. * include/std/ratio: Likewise. * include/std/chrono: Likewise. * include/std/condition_variable: Likewise. * include/std/mutex: Likewise. * include/std/functional: Likewise. * include/std/complex: Likewise. * include/std/typeindex: Likewise. * include/std/array: Likewise. * include/bits/regex_compiler.h: Likewise. * include/bits/regex_grep_matcher.tcc: Likewise. * include/bits/regex_grep_matcher.h: Likewise. * include/bits/regex_constants.h: Likewise. * include/bits/regex_cursor.h: Likewise. * include/bits/regex_nfa.tcc: Likewise. * include/bits/shared_ptr_base.h: Likewise. * include/bits/regex_nfa.h: Likewise. * include/bits/random.tcc: Likewise. * include/bits/regex.h: Likewise. * include/bits/random.h: Likewise. * include/bits/regex_error.h: Likewise. * include/c_global/cinttypes: Likewise. * include/c_global/cstdlib: Likewise. * include/c_global/cstdio: Likewise. * include/c_global/cctype: Likewise. * include/c_global/cmath: Likewise. * include/c_global/cfenv: Likewise. * include/c_global/cwchar: Likewise. * include/c_global/cstdint: Likewise. * include/c_global/cwctype: Likewise. * include/tr1/shared_ptr.h: Likewise. * include/tr1/cinttypes: Likewise. * include/tr1/cstdio: Likewise. * include/tr1/cfenv: Likewise. * include/tr1/utility: Likewise. * include/tr1/cwchar: Likewise. * include/tr1/type_traits: Likewise. * include/tr1/memory: Likewise. * include/tr1/cstdint: Likewise. * include/tr1/regex: Likewise. * include/tr1/cwctype: Likewise. * include/tr1/cstdlib: Likewise. * include/tr1/cctype: Likewise. * include/tr1/cmath: Likewise. * include/tr1/complex: Likewise. * include/tr1/array: Likewise. * include/c_compatibility/fenv.h: Likewise. * include/c_compatibility/stdint.h: Likewise. * include/c_compatibility/inttypes.h: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820.cc: Adjust dg-error line numbers. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/ typedefs_neg.cc: Likewise. * testsuite/20_util/declval/requirements/1_neg.cc: Likewise. * testsuite/20_util/shared_ptr/cons/43820.cc: Likewise. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise. From-SVN: r166211
2010-11-02 19:51:23 +01:00
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/**
* @defgroup futures Futures
* @ingroup concurrency
*
* Classes for futures support.
* @{
*/
/// Error code for futures
enum class future_errc
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
future_already_retrieved = 1,
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
promise_already_satisfied,
no_state,
broken_promise
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
};
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
libstdc++: N3126 draft support. * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits<T>::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. From-SVN: r166171
2010-11-02 03:35:28 +01:00
/// Specialization.
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
template<>
struct is_error_code_enum<future_errc> : public true_type { };
/// Points to a statically-allocated object derived from error_category.
libstdc++: N3126 draft support. * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits<T>::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. From-SVN: r166171
2010-11-02 03:35:28 +01:00
const error_category&
future_category() noexcept;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
libstdc++: N3126 draft support. * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits<T>::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. From-SVN: r166171
2010-11-02 03:35:28 +01:00
/// Overload for make_error_code.
inline error_code
make_error_code(future_errc __errc) noexcept
libstdc++: N3126 draft support. * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits<T>::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. From-SVN: r166171
2010-11-02 03:35:28 +01:00
{ return error_code(static_cast<int>(__errc), future_category()); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
libstdc++: N3126 draft support. * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits<T>::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. From-SVN: r166171
2010-11-02 03:35:28 +01:00
/// Overload for make_error_condition.
inline error_condition
make_error_condition(future_errc __errc) noexcept
libstdc++: N3126 draft support. * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits<T>::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. From-SVN: r166171
2010-11-02 03:35:28 +01:00
{ return error_condition(static_cast<int>(__errc), future_category()); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/**
* @brief Exception type thrown by futures.
* @ingroup exceptions
*/
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
class future_error : public logic_error
{
error_code _M_code;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
explicit future_error(error_code __ec)
: logic_error("std::future_error: " + __ec.message()), _M_code(__ec)
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{ }
virtual ~future_error() noexcept;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
virtual const char*
what() const noexcept;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
const error_code&
code() const noexcept { return _M_code; }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
// Forward declarations.
template<typename _Res>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
class future;
template<typename _Res>
class shared_future;
template<typename _Signature>
class packaged_task;
template<typename _Res>
class promise;
libstdc++: N3126 draft support. * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits<T>::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. From-SVN: r166171
2010-11-02 03:35:28 +01:00
/// Launch code for futures
enum class launch
{
async = 1,
deferred = 2
libstdc++: N3126 draft support. * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits<T>::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. From-SVN: r166171
2010-11-02 03:35:28 +01:00
};
constexpr launch operator&(launch __x, launch __y)
{
return static_cast<launch>(
static_cast<int>(__x) & static_cast<int>(__y));
}
constexpr launch operator|(launch __x, launch __y)
{
return static_cast<launch>(
static_cast<int>(__x) | static_cast<int>(__y));
}
constexpr launch operator^(launch __x, launch __y)
{
return static_cast<launch>(
static_cast<int>(__x) ^ static_cast<int>(__y));
}
constexpr launch operator~(launch __x)
{ return static_cast<launch>(~static_cast<int>(__x)); }
inline launch& operator&=(launch& __x, launch __y)
{ return __x = __x & __y; }
inline launch& operator|=(launch& __x, launch __y)
{ return __x = __x | __y; }
inline launch& operator^=(launch& __x, launch __y)
{ return __x = __x ^ __y; }
libstdc++: N3126 draft support. * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits<T>::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. From-SVN: r166171
2010-11-02 03:35:28 +01:00
/// Status code for futures
enum class future_status
libstdc++: N3126 draft support. * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits<T>::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. From-SVN: r166171
2010-11-02 03:35:28 +01:00
{
ready,
timeout,
deferred
};
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2021. Further incorrect usages of result_of
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename _Fn, typename... _Args>
using __async_result_of = typename result_of<
typename decay<_Fn>::type(typename decay<_Args>::type...)>::type;
template<typename _Fn, typename... _Args>
future<__async_result_of<_Fn, _Args...>>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
async(launch __policy, _Fn&& __fn, _Args&&... __args);
template<typename _Fn, typename... _Args>
future<__async_result_of<_Fn, _Args...>>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
async(_Fn&& __fn, _Args&&... __args);
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \
&& (ATOMIC_INT_LOCK_FREE > 1)
/// Base class and enclosing scope.
struct __future_base
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
/// Base class for results.
struct _Result_base
{
exception_ptr _M_error;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
_Result_base(const _Result_base&) = delete;
_Result_base& operator=(const _Result_base&) = delete;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
// _M_destroy() allows derived classes to control deallocation
virtual void _M_destroy() = 0;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
struct _Deleter
{
void operator()(_Result_base* __fr) const { __fr->_M_destroy(); }
};
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
protected:
2011-03-15 01:24:08 +01:00
_Result_base();
virtual ~_Result_base();
};
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
/// A unique_ptr for result objects.
template<typename _Res>
using _Ptr = unique_ptr<_Res, _Result_base::_Deleter>;
/// A result object that has storage for an object of type _Res.
template<typename _Res>
struct _Result : _Result_base
{
private:
__gnu_cxx::__aligned_buffer<_Res> _M_storage;
bool _M_initialized;
public:
typedef _Res result_type;
_Result() noexcept : _M_initialized() { }
~_Result()
{
if (_M_initialized)
_M_value().~_Res();
}
// Return lvalue, future will add const or rvalue-reference
_Res&
_M_value() noexcept { return *_M_storage._M_ptr(); }
void
_M_set(const _Res& __res)
{
::new (_M_storage._M_addr()) _Res(__res);
_M_initialized = true;
}
void
_M_set(_Res&& __res)
{
::new (_M_storage._M_addr()) _Res(std::move(__res));
_M_initialized = true;
}
private:
void _M_destroy() { delete this; }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
/// A result object that uses an allocator.
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename _Res, typename _Alloc>
struct _Result_alloc final : _Result<_Res>, _Alloc
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
using __allocator_type = __alloc_rebind<_Alloc, _Result_alloc>;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
explicit
_Result_alloc(const _Alloc& __a) : _Result<_Res>(), _Alloc(__a)
{ }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
private:
void _M_destroy()
{
__allocator_type __a(*this);
__allocated_ptr<__allocator_type> __guard_ptr{ __a, this };
this->~_Result_alloc();
}
};
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Create a result object that uses an allocator.
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename _Res, typename _Allocator>
static _Ptr<_Result_alloc<_Res, _Allocator>>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
_S_allocate_result(const _Allocator& __a)
{
using __result_type = _Result_alloc<_Res, _Allocator>;
typename __result_type::__allocator_type __a2(__a);
auto __guard = std::__allocate_guarded(__a2);
__result_type* __p = ::new((void*)__guard.get()) __result_type{__a};
__guard = nullptr;
return _Ptr<__result_type>(__p);
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
}
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Keep it simple for std::allocator.
template<typename _Res, typename _Tp>
static _Ptr<_Result<_Res>>
_S_allocate_result(const std::allocator<_Tp>& __a)
{
return _Ptr<_Result<_Res>>(new _Result<_Res>);
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Base class for various types of shared state created by an
// asynchronous provider (such as a std::promise) and shared with one
// or more associated futures.
class _State_baseV2
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
typedef _Ptr<_Result_base> _Ptr_type;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
enum _Status : unsigned {
__not_ready,
__ready
};
_Ptr_type _M_result;
__atomic_futex_unsigned<> _M_status;
atomic_flag _M_retrieved = ATOMIC_FLAG_INIT;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
once_flag _M_once;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
_State_baseV2() noexcept : _M_result(), _M_status(_Status::__not_ready)
{ }
_State_baseV2(const _State_baseV2&) = delete;
_State_baseV2& operator=(const _State_baseV2&) = delete;
virtual ~_State_baseV2() = default;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
_Result_base&
wait()
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Run any deferred function or join any asynchronous thread:
_M_complete_async();
// Acquire MO makes sure this synchronizes with the thread that made
// the future ready.
_M_status._M_load_when_equal(_Status::__ready, memory_order_acquire);
return *_M_result;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
}
template<typename _Rep, typename _Period>
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
future_status
wait_for(const chrono::duration<_Rep, _Period>& __rel)
{
// First, check if the future has been made ready. Use acquire MO
// to synchronize with the thread that made it ready.
if (_M_status._M_load(memory_order_acquire) == _Status::__ready)
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
return future_status::ready;
if (_M_is_deferred_future())
return future_status::deferred;
if (_M_status._M_load_when_equal_for(_Status::__ready,
memory_order_acquire, __rel))
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2100. timed waiting functions must also join
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// This call is a no-op by default except on an async future,
// in which case the async thread is joined. It's also not a
// no-op for a deferred future, but such a future will never
// reach this point because it returns future_status::deferred
// instead of waiting for the future to become ready (see
// above). Async futures synchronize in this call, so we need
// no further synchronization here.
_M_complete_async();
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
return future_status::ready;
}
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
return future_status::timeout;
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
template<typename _Clock, typename _Duration>
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
future_status
wait_until(const chrono::time_point<_Clock, _Duration>& __abs)
{
// First, check if the future has been made ready. Use acquire MO
// to synchronize with the thread that made it ready.
if (_M_status._M_load(memory_order_acquire) == _Status::__ready)
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
return future_status::ready;
if (_M_is_deferred_future())
return future_status::deferred;
if (_M_status._M_load_when_equal_until(_Status::__ready,
memory_order_acquire, __abs))
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2100. timed waiting functions must also join
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// See wait_for(...) above.
_M_complete_async();
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
return future_status::ready;
}
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
return future_status::timeout;
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Provide a result to the shared state and make it ready.
// Calls at most once: _M_result = __res();
void
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
_M_set_result(function<_Ptr_type()> __res, bool __ignore_failure = false)
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
bool __did_set = false;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
// all calls to this function are serialized,
// side-effects of invoking __res only happen once
call_once(_M_once, &_State_baseV2::_M_do_set, this,
std::__addressof(__res), std::__addressof(__did_set));
if (__did_set)
// Use release MO to synchronize with observers of the ready state.
_M_status._M_store_notify_all(_Status::__ready,
memory_order_release);
else if (!__ignore_failure)
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
__throw_future_error(int(future_errc::promise_already_satisfied));
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
}
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Provide a result to the shared state but delay making it ready
// until the calling thread exits.
// Calls at most once: _M_result = __res();
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
void
_M_set_delayed_result(function<_Ptr_type()> __res,
weak_ptr<_State_baseV2> __self)
{
bool __did_set = false;
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
unique_ptr<_Make_ready> __mr{new _Make_ready};
// all calls to this function are serialized,
// side-effects of invoking __res only happen once
call_once(_M_once, &_State_baseV2::_M_do_set, this,
std::__addressof(__res), std::__addressof(__did_set));
if (!__did_set)
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
__throw_future_error(int(future_errc::promise_already_satisfied));
__mr->_M_shared_state = std::move(__self);
__mr->_M_set();
__mr.release();
}
// Abandon this shared state.
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void
_M_break_promise(_Ptr_type __res)
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
if (static_cast<bool>(__res))
{
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
error_code __ec(make_error_code(future_errc::broken_promise));
__res->_M_error = make_exception_ptr(future_error(__ec));
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// This function is only called when the last asynchronous result
// provider is abandoning this shared state, so noone can be
// trying to make the shared state ready at the same time, and
// we can access _M_result directly instead of through call_once.
_M_result.swap(__res);
// Use release MO to synchronize with observers of the ready state.
_M_status._M_store_notify_all(_Status::__ready,
memory_order_release);
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
}
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Called when this object is first passed to a future.
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void
_M_set_retrieved_flag()
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
if (_M_retrieved.test_and_set())
__throw_future_error(int(future_errc::future_already_retrieved));
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
}
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename _Res, typename _Arg>
struct _Setter;
// set lvalues
template<typename _Res, typename _Arg>
struct _Setter<_Res, _Arg&>
{
// check this is only used by promise<R>::set_value(const R&)
// or promise<R&>::set_value(R&)
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
static_assert(is_same<_Res, _Arg&>::value // promise<R&>
|| is_same<const _Res, _Arg>::value, // promise<R>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
"Invalid specialisation");
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Used by std::promise to copy construct the result.
typename promise<_Res>::_Ptr_type operator()() const
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
_State_baseV2::_S_check(_M_promise->_M_future);
_M_promise->_M_storage->_M_set(*_M_arg);
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
return std::move(_M_promise->_M_storage);
}
promise<_Res>* _M_promise;
_Arg* _M_arg;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
};
// set rvalues
template<typename _Res>
struct _Setter<_Res, _Res&&>
{
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Used by std::promise to move construct the result.
typename promise<_Res>::_Ptr_type operator()() const
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
_State_baseV2::_S_check(_M_promise->_M_future);
_M_promise->_M_storage->_M_set(std::move(*_M_arg));
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
return std::move(_M_promise->_M_storage);
}
promise<_Res>* _M_promise;
_Res* _M_arg;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
};
struct __exception_ptr_tag { };
// set exceptions
template<typename _Res>
struct _Setter<_Res, __exception_ptr_tag>
{
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Used by std::promise to store an exception as the result.
typename promise<_Res>::_Ptr_type operator()() const
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
_State_baseV2::_S_check(_M_promise->_M_future);
_M_promise->_M_storage->_M_error = *_M_ex;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
return std::move(_M_promise->_M_storage);
}
promise<_Res>* _M_promise;
exception_ptr* _M_ex;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
};
template<typename _Res, typename _Arg>
static _Setter<_Res, _Arg&&>
__setter(promise<_Res>* __prom, _Arg&& __arg)
{
return _Setter<_Res, _Arg&&>{ __prom, std::__addressof(__arg) };
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
}
template<typename _Res>
static _Setter<_Res, __exception_ptr_tag>
__setter(exception_ptr& __ex, promise<_Res>* __prom)
{
return _Setter<_Res, __exception_ptr_tag>{ __prom, &__ex };
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
}
template<typename _Tp>
static void
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
_S_check(const shared_ptr<_Tp>& __p)
{
if (!static_cast<bool>(__p))
__throw_future_error((int)future_errc::no_state);
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
private:
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// The function invoked with std::call_once(_M_once, ...).
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
void
_M_do_set(function<_Ptr_type()>* __f, bool* __did_set)
{
_Ptr_type __res = (*__f)();
// Notify the caller that we did try to set; if we do not throw an
// exception, the caller will be aware that it did set (e.g., see
// _M_set_result).
*__did_set = true;
_M_result.swap(__res); // nothrow
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// Wait for completion of async function.
virtual void _M_complete_async() { }
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Return true if state corresponds to a deferred function.
virtual bool _M_is_deferred_future() const { return false; }
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
struct _Make_ready final : __at_thread_exit_elt
{
weak_ptr<_State_baseV2> _M_shared_state;
static void _S_run(void*);
void _M_set();
};
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
#ifdef _GLIBCXX_ASYNC_ABI_COMPAT
class _State_base;
class _Async_state_common;
#else
using _State_base = _State_baseV2;
class _Async_state_commonV2;
#endif
template<typename _BoundFn, typename = typename _BoundFn::result_type>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
class _Deferred_state;
template<typename _BoundFn, typename = typename _BoundFn::result_type>
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
class _Async_state_impl;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename _Signature>
class _Task_state_base;
template<typename _Fn, typename _Alloc, typename _Signature>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
class _Task_state;
template<typename _BoundFn>
static std::shared_ptr<_State_base>
_S_make_deferred_state(_BoundFn&& __fn);
template<typename _BoundFn>
static std::shared_ptr<_State_base>
_S_make_async_state(_BoundFn&& __fn);
template<typename _Res_ptr, typename _Fn,
typename _Res = typename _Res_ptr::element_type::result_type>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
struct _Task_setter;
template<typename _Res_ptr, typename _BoundFn>
static _Task_setter<_Res_ptr, _BoundFn>
_S_task_setter(_Res_ptr& __ptr, _BoundFn& __call)
{
return { std::__addressof(__ptr), std::__addressof(__call) };
}
};
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/// Partial specialization for reference types.
template<typename _Res>
struct __future_base::_Result<_Res&> : __future_base::_Result_base
{
typedef _Res& result_type;
_Result() noexcept : _M_value_ptr() { }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
void
_M_set(_Res& __res) noexcept
{ _M_value_ptr = std::addressof(__res); }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
_Res& _M_get() noexcept { return *_M_value_ptr; }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
private:
_Res* _M_value_ptr;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void _M_destroy() { delete this; }
};
/// Explicit specialization for void.
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
template<>
struct __future_base::_Result<void> : __future_base::_Result_base
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
typedef void result_type;
private:
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void _M_destroy() { delete this; }
};
#ifndef _GLIBCXX_ASYNC_ABI_COMPAT
// Allow _Setter objects to be stored locally in std::function
template<typename _Res, typename _Arg>
struct __is_location_invariant
<__future_base::_State_base::_Setter<_Res, _Arg>>
: true_type { };
// Allow _Task_setter objects to be stored locally in std::function
template<typename _Res_ptr, typename _Fn, typename _Res>
struct __is_location_invariant
<__future_base::_Task_setter<_Res_ptr, _Fn, _Res>>
: true_type { };
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
/// Common implementation for future and shared_future.
template<typename _Res>
class __basic_future : public __future_base
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
protected:
2011-03-15 01:24:08 +01:00
typedef shared_ptr<_State_base> __state_type;
typedef __future_base::_Result<_Res>& __result_type;
private:
__state_type _M_state;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
// Disable copying.
__basic_future(const __basic_future&) = delete;
__basic_future& operator=(const __basic_future&) = delete;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
bool
valid() const noexcept { return static_cast<bool>(_M_state); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void
wait() const
{
2011-03-15 01:24:08 +01:00
_State_base::_S_check(_M_state);
_M_state->wait();
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
template<typename _Rep, typename _Period>
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
future_status
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
wait_for(const chrono::duration<_Rep, _Period>& __rel) const
{
2011-03-15 01:24:08 +01:00
_State_base::_S_check(_M_state);
return _M_state->wait_for(__rel);
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
template<typename _Clock, typename _Duration>
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
future_status
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
wait_until(const chrono::time_point<_Clock, _Duration>& __abs) const
{
2011-03-15 01:24:08 +01:00
_State_base::_S_check(_M_state);
return _M_state->wait_until(__abs);
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
protected:
/// Wait for the state to be ready and rethrow any stored exception
__result_type
_M_get_result() const
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
2011-03-15 01:24:08 +01:00
_State_base::_S_check(_M_state);
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
_Result_base& __res = _M_state->wait();
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
if (!(__res._M_error == 0))
rethrow_exception(__res._M_error);
return static_cast<__result_type>(__res);
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
}
void _M_swap(__basic_future& __that) noexcept
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
_M_state.swap(__that._M_state);
}
// Construction of a future by promise::get_future()
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
explicit
__basic_future(const __state_type& __state) : _M_state(__state)
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
2011-03-15 01:24:08 +01:00
_State_base::_S_check(_M_state);
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
_M_state->_M_set_retrieved_flag();
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
}
// Copy construction from a shared_future
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
explicit
__basic_future(const shared_future<_Res>&) noexcept;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
// Move construction from a shared_future
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
explicit
__basic_future(shared_future<_Res>&&) noexcept;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
// Move construction from a future
explicit
__basic_future(future<_Res>&&) noexcept;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
constexpr __basic_future() noexcept : _M_state() { }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
struct _Reset
{
explicit _Reset(__basic_future& __fut) noexcept : _M_fut(__fut) { }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
~_Reset() { _M_fut._M_state.reset(); }
__basic_future& _M_fut;
};
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
/// Primary template for future.
template<typename _Res>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
class future : public __basic_future<_Res>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
friend class promise<_Res>;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename> friend class packaged_task;
template<typename _Fn, typename... _Args>
friend future<__async_result_of<_Fn, _Args...>>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
async(launch, _Fn&&, _Args&&...);
typedef __basic_future<_Res> _Base_type;
typedef typename _Base_type::__state_type __state_type;
explicit
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future(const __state_type& __state) : _Base_type(__state) { }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
constexpr future() noexcept : _Base_type() { }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/// Move constructor
future(future&& __uf) noexcept : _Base_type(std::move(__uf)) { }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// Disable copying
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future(const future&) = delete;
future& operator=(const future&) = delete;
future& operator=(future&& __fut) noexcept
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
future(std::move(__fut))._M_swap(*this);
return *this;
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/// Retrieving the value
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
_Res
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
get()
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
typename _Base_type::_Reset __reset(*this);
return std::move(this->_M_get_result()._M_value());
}
shared_future<_Res> share();
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
/// Partial specialization for future<R&>
template<typename _Res>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
class future<_Res&> : public __basic_future<_Res&>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
friend class promise<_Res&>;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename> friend class packaged_task;
template<typename _Fn, typename... _Args>
friend future<__async_result_of<_Fn, _Args...>>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
async(launch, _Fn&&, _Args&&...);
typedef __basic_future<_Res&> _Base_type;
typedef typename _Base_type::__state_type __state_type;
explicit
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future(const __state_type& __state) : _Base_type(__state) { }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
constexpr future() noexcept : _Base_type() { }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/// Move constructor
future(future&& __uf) noexcept : _Base_type(std::move(__uf)) { }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// Disable copying
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future(const future&) = delete;
future& operator=(const future&) = delete;
future& operator=(future&& __fut) noexcept
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
future(std::move(__fut))._M_swap(*this);
return *this;
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/// Retrieving the value
_Res&
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
get()
{
typename _Base_type::_Reset __reset(*this);
return this->_M_get_result()._M_get();
}
shared_future<_Res&> share();
};
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
/// Explicit specialization for future<void>
template<>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
class future<void> : public __basic_future<void>
{
friend class promise<void>;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename> friend class packaged_task;
template<typename _Fn, typename... _Args>
friend future<__async_result_of<_Fn, _Args...>>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
async(launch, _Fn&&, _Args&&...);
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
typedef __basic_future<void> _Base_type;
typedef typename _Base_type::__state_type __state_type;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
explicit
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future(const __state_type& __state) : _Base_type(__state) { }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
constexpr future() noexcept : _Base_type() { }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/// Move constructor
future(future&& __uf) noexcept : _Base_type(std::move(__uf)) { }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// Disable copying
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future(const future&) = delete;
future& operator=(const future&) = delete;
future& operator=(future&& __fut) noexcept
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
future(std::move(__fut))._M_swap(*this);
return *this;
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/// Retrieving the value
void
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
get()
{
typename _Base_type::_Reset __reset(*this);
this->_M_get_result();
}
shared_future<void> share();
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
/// Primary template for shared_future.
template<typename _Res>
class shared_future : public __basic_future<_Res>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
typedef __basic_future<_Res> _Base_type;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
constexpr shared_future() noexcept : _Base_type() { }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/// Copy constructor
shared_future(const shared_future& __sf) : _Base_type(__sf) { }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
/// Construct from a future rvalue
shared_future(future<_Res>&& __uf) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
: _Base_type(std::move(__uf))
{ }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
/// Construct from a shared_future rvalue
shared_future(shared_future&& __sf) noexcept
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
: _Base_type(std::move(__sf))
{ }
shared_future& operator=(const shared_future& __sf)
{
shared_future(__sf)._M_swap(*this);
return *this;
}
shared_future& operator=(shared_future&& __sf) noexcept
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
shared_future(std::move(__sf))._M_swap(*this);
return *this;
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/// Retrieving the value
const _Res&
get() const { return this->_M_get_result()._M_value(); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
/// Partial specialization for shared_future<R&>
template<typename _Res>
class shared_future<_Res&> : public __basic_future<_Res&>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
typedef __basic_future<_Res&> _Base_type;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
constexpr shared_future() noexcept : _Base_type() { }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/// Copy constructor
shared_future(const shared_future& __sf) : _Base_type(__sf) { }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
/// Construct from a future rvalue
shared_future(future<_Res&>&& __uf) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
: _Base_type(std::move(__uf))
{ }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
/// Construct from a shared_future rvalue
shared_future(shared_future&& __sf) noexcept
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
: _Base_type(std::move(__sf))
{ }
shared_future& operator=(const shared_future& __sf)
{
shared_future(__sf)._M_swap(*this);
return *this;
}
shared_future& operator=(shared_future&& __sf) noexcept
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
shared_future(std::move(__sf))._M_swap(*this);
return *this;
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/// Retrieving the value
_Res&
get() const { return this->_M_get_result()._M_get(); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
/// Explicit specialization for shared_future<void>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
template<>
class shared_future<void> : public __basic_future<void>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
typedef __basic_future<void> _Base_type;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
constexpr shared_future() noexcept : _Base_type() { }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
/// Copy constructor
shared_future(const shared_future& __sf) : _Base_type(__sf) { }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
/// Construct from a future rvalue
shared_future(future<void>&& __uf) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
: _Base_type(std::move(__uf))
{ }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
/// Construct from a shared_future rvalue
shared_future(shared_future&& __sf) noexcept
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
: _Base_type(std::move(__sf))
{ }
shared_future& operator=(const shared_future& __sf)
{
shared_future(__sf)._M_swap(*this);
return *this;
}
shared_future& operator=(shared_future&& __sf) noexcept
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
shared_future(std::move(__sf))._M_swap(*this);
return *this;
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// Retrieving the value
void
get() const { this->_M_get_result(); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
// Now we can define the protected __basic_future constructors.
template<typename _Res>
inline __basic_future<_Res>::
__basic_future(const shared_future<_Res>& __sf) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
: _M_state(__sf._M_state)
{ }
template<typename _Res>
inline __basic_future<_Res>::
__basic_future(shared_future<_Res>&& __sf) noexcept
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
: _M_state(std::move(__sf._M_state))
{ }
template<typename _Res>
inline __basic_future<_Res>::
__basic_future(future<_Res>&& __uf) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
: _M_state(std::move(__uf._M_state))
{ }
template<typename _Res>
inline shared_future<_Res>
future<_Res>::share()
{ return shared_future<_Res>(std::move(*this)); }
template<typename _Res>
inline shared_future<_Res&>
future<_Res&>::share()
{ return shared_future<_Res&>(std::move(*this)); }
inline shared_future<void>
future<void>::share()
{ return shared_future<void>(std::move(*this)); }
/// Primary template for promise
template<typename _Res>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
class promise
{
typedef __future_base::_State_base _State;
typedef __future_base::_Result<_Res> _Res_type;
typedef __future_base::_Ptr<_Res_type> _Ptr_type;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename, typename> friend class _State::_Setter;
shared_ptr<_State> _M_future;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
_Ptr_type _M_storage;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
promise()
: _M_future(std::make_shared<_State>()),
_M_storage(new _Res_type())
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{ }
promise(promise&& __rhs) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
: _M_future(std::move(__rhs._M_future)),
_M_storage(std::move(__rhs._M_storage))
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{ }
template<typename _Allocator>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
promise(allocator_arg_t, const _Allocator& __a)
: _M_future(std::allocate_shared<_State>(__a)),
_M_storage(__future_base::_S_allocate_result<_Res>(__a))
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{ }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
template<typename _Allocator>
promise(allocator_arg_t, const _Allocator&, promise&& __rhs)
: _M_future(std::move(__rhs._M_future)),
_M_storage(std::move(__rhs._M_storage))
{ }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
promise(const promise&) = delete;
~promise()
{
if (static_cast<bool>(_M_future) && !_M_future.unique())
_M_future->_M_break_promise(std::move(_M_storage));
}
// Assignment
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
promise&
operator=(promise&& __rhs) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
promise(std::move(__rhs)).swap(*this);
return *this;
}
promise& operator=(const promise&) = delete;
void
swap(promise& __rhs) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
_M_future.swap(__rhs._M_future);
_M_storage.swap(__rhs._M_storage);
}
// Retrieving the result
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future<_Res>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
get_future()
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{ return future<_Res>(_M_future); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// Setting the result
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void
set_value(const _Res& __r)
{ _M_future->_M_set_result(_State::__setter(this, __r)); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void
set_value(_Res&& __r)
{ _M_future->_M_set_result(_State::__setter(this, std::move(__r))); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void
set_exception(exception_ptr __p)
{ _M_future->_M_set_result(_State::__setter(__p, this)); }
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
void
set_value_at_thread_exit(const _Res& __r)
{
_M_future->_M_set_delayed_result(_State::__setter(this, __r),
_M_future);
}
void
set_value_at_thread_exit(_Res&& __r)
{
_M_future->_M_set_delayed_result(
_State::__setter(this, std::move(__r)), _M_future);
}
void
set_exception_at_thread_exit(exception_ptr __p)
{
_M_future->_M_set_delayed_result(_State::__setter(__p, this),
_M_future);
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
template<typename _Res>
inline void
swap(promise<_Res>& __x, promise<_Res>& __y) noexcept
{ __x.swap(__y); }
template<typename _Res, typename _Alloc>
struct uses_allocator<promise<_Res>, _Alloc>
: public true_type { };
/// Partial specialization for promise<R&>
template<typename _Res>
class promise<_Res&>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
typedef __future_base::_State_base _State;
typedef __future_base::_Result<_Res&> _Res_type;
typedef __future_base::_Ptr<_Res_type> _Ptr_type;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename, typename> friend class _State::_Setter;
shared_ptr<_State> _M_future;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
_Ptr_type _M_storage;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
promise()
: _M_future(std::make_shared<_State>()),
_M_storage(new _Res_type())
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{ }
promise(promise&& __rhs) noexcept
: _M_future(std::move(__rhs._M_future)),
_M_storage(std::move(__rhs._M_storage))
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{ }
template<typename _Allocator>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
promise(allocator_arg_t, const _Allocator& __a)
: _M_future(std::allocate_shared<_State>(__a)),
_M_storage(__future_base::_S_allocate_result<_Res&>(__a))
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{ }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
template<typename _Allocator>
promise(allocator_arg_t, const _Allocator&, promise&& __rhs)
: _M_future(std::move(__rhs._M_future)),
_M_storage(std::move(__rhs._M_storage))
{ }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
promise(const promise&) = delete;
~promise()
{
if (static_cast<bool>(_M_future) && !_M_future.unique())
_M_future->_M_break_promise(std::move(_M_storage));
}
// Assignment
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
promise&
operator=(promise&& __rhs) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
promise(std::move(__rhs)).swap(*this);
return *this;
}
promise& operator=(const promise&) = delete;
void
swap(promise& __rhs) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
_M_future.swap(__rhs._M_future);
_M_storage.swap(__rhs._M_storage);
}
// Retrieving the result
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future<_Res&>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
get_future()
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{ return future<_Res&>(_M_future); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// Setting the result
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void
set_value(_Res& __r)
{ _M_future->_M_set_result(_State::__setter(this, __r)); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void
set_exception(exception_ptr __p)
{ _M_future->_M_set_result(_State::__setter(__p, this)); }
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
void
set_value_at_thread_exit(_Res& __r)
{
_M_future->_M_set_delayed_result(_State::__setter(this, __r),
_M_future);
}
void
set_exception_at_thread_exit(exception_ptr __p)
{
_M_future->_M_set_delayed_result(_State::__setter(__p, this),
_M_future);
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
/// Explicit specialization for promise<void>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
template<>
class promise<void>
{
typedef __future_base::_State_base _State;
typedef __future_base::_Result<void> _Res_type;
typedef __future_base::_Ptr<_Res_type> _Ptr_type;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename, typename> friend class _State::_Setter;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
shared_ptr<_State> _M_future;
_Ptr_type _M_storage;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
promise()
: _M_future(std::make_shared<_State>()),
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
_M_storage(new _Res_type())
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{ }
promise(promise&& __rhs) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
: _M_future(std::move(__rhs._M_future)),
_M_storage(std::move(__rhs._M_storage))
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{ }
template<typename _Allocator>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
promise(allocator_arg_t, const _Allocator& __a)
: _M_future(std::allocate_shared<_State>(__a)),
_M_storage(__future_base::_S_allocate_result<void>(__a))
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{ }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2095. missing constructors needed for uses-allocator construction
template<typename _Allocator>
promise(allocator_arg_t, const _Allocator&, promise&& __rhs)
: _M_future(std::move(__rhs._M_future)),
_M_storage(std::move(__rhs._M_storage))
{ }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
promise(const promise&) = delete;
~promise()
{
if (static_cast<bool>(_M_future) && !_M_future.unique())
_M_future->_M_break_promise(std::move(_M_storage));
}
// Assignment
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
promise&
operator=(promise&& __rhs) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
promise(std::move(__rhs)).swap(*this);
return *this;
}
promise& operator=(const promise&) = delete;
void
swap(promise& __rhs) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
_M_future.swap(__rhs._M_future);
_M_storage.swap(__rhs._M_storage);
}
// Retrieving the result
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future<void>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
get_future()
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{ return future<void>(_M_future); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// Setting the result
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
void set_value();
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
set_exception(exception_ptr __p)
{ _M_future->_M_set_result(_State::__setter(__p, this)); }
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
void
set_value_at_thread_exit();
void
set_exception_at_thread_exit(exception_ptr __p)
{
_M_future->_M_set_delayed_result(_State::__setter(__p, this),
_M_future);
}
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
};
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
// set void
template<>
2011-03-15 01:24:08 +01:00
struct __future_base::_State_base::_Setter<void, void>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
promise<void>::_Ptr_type operator()() const
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
2011-03-15 01:24:08 +01:00
_State_base::_S_check(_M_promise->_M_future);
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
return std::move(_M_promise->_M_storage);
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
}
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
promise<void>* _M_promise;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
inline void
promise<void>::set_value()
{ _M_future->_M_set_result(_State::_Setter<void, void>{ this }); }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
inline void
promise<void>::set_value_at_thread_exit()
{
_M_future->_M_set_delayed_result(_State::_Setter<void, void>{this},
_M_future);
}
template<typename _Ptr_type, typename _Fn, typename _Res>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
struct __future_base::_Task_setter
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Invoke the function and provide the result to the caller.
_Ptr_type operator()() const
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
__try
{
(*_M_result)->_M_set((*_M_fn)());
}
__catch(const __cxxabiv1::__forced_unwind&)
{
__throw_exception_again; // will cause broken_promise
}
__catch(...)
{
(*_M_result)->_M_error = current_exception();
}
return std::move(*_M_result);
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
}
_Ptr_type* _M_result;
_Fn* _M_fn;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
template<typename _Ptr_type, typename _Fn>
struct __future_base::_Task_setter<_Ptr_type, _Fn, void>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
_Ptr_type operator()() const
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
__try
{
(*_M_fn)();
}
__catch(const __cxxabiv1::__forced_unwind&)
{
__throw_exception_again; // will cause broken_promise
}
__catch(...)
{
(*_M_result)->_M_error = current_exception();
}
return std::move(*_M_result);
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
}
_Ptr_type* _M_result;
_Fn* _M_fn;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Holds storage for a packaged_task's result.
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename _Res, typename... _Args>
struct __future_base::_Task_state_base<_Res(_Args...)>
2011-03-15 01:24:08 +01:00
: __future_base::_State_base
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
typedef _Res _Res_type;
template<typename _Alloc>
_Task_state_base(const _Alloc& __a)
: _M_result(_S_allocate_result<_Res>(__a))
{ }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Invoke the stored task and make the state ready.
virtual void
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
_M_run(_Args&&... __args) = 0;
// Invoke the stored task and make the state ready at thread exit.
virtual void
_M_run_delayed(_Args&&... __args, weak_ptr<_State_base>) = 0;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
virtual shared_ptr<_Task_state_base>
_M_reset() = 0;
typedef __future_base::_Ptr<_Result<_Res>> _Ptr_type;
_Ptr_type _M_result;
};
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Holds a packaged_task's stored task.
template<typename _Fn, typename _Alloc, typename _Res, typename... _Args>
struct __future_base::_Task_state<_Fn, _Alloc, _Res(_Args...)> final
: __future_base::_Task_state_base<_Res(_Args...)>
{
template<typename _Fn2>
_Task_state(_Fn2&& __fn, const _Alloc& __a)
: _Task_state_base<_Res(_Args...)>(__a),
_M_impl(std::forward<_Fn2>(__fn), __a)
{ }
private:
virtual void
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
_M_run(_Args&&... __args)
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
// bound arguments decay so wrap lvalue references
auto __boundfn = std::__bind_simple(std::ref(_M_impl._M_fn),
_S_maybe_wrap_ref(std::forward<_Args>(__args))...);
this->_M_set_result(_S_task_setter(this->_M_result, __boundfn));
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
}
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
virtual void
_M_run_delayed(_Args&&... __args, weak_ptr<_State_base> __self)
{
// bound arguments decay so wrap lvalue references
auto __boundfn = std::__bind_simple(std::ref(_M_impl._M_fn),
_S_maybe_wrap_ref(std::forward<_Args>(__args))...);
this->_M_set_delayed_result(_S_task_setter(this->_M_result, __boundfn),
std::move(__self));
}
virtual shared_ptr<_Task_state_base<_Res(_Args...)>>
_M_reset();
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename _Tp>
static reference_wrapper<_Tp>
_S_maybe_wrap_ref(_Tp& __t)
{ return std::ref(__t); }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename _Tp>
static
typename enable_if<!is_lvalue_reference<_Tp>::value, _Tp>::type&&
_S_maybe_wrap_ref(_Tp&& __t)
{ return std::forward<_Tp>(__t); }
struct _Impl : _Alloc
{
template<typename _Fn2>
_Impl(_Fn2&& __fn, const _Alloc& __a)
: _Alloc(__a), _M_fn(std::forward<_Fn2>(__fn)) { }
_Fn _M_fn;
} _M_impl;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
};
template<typename _Signature, typename _Fn, typename _Alloc>
static shared_ptr<__future_base::_Task_state_base<_Signature>>
__create_task_state(_Fn&& __fn, const _Alloc& __a)
{
typedef typename decay<_Fn>::type _Fn2;
typedef __future_base::_Task_state<_Fn2, _Alloc, _Signature> _State;
return std::allocate_shared<_State>(__a, std::forward<_Fn>(__fn), __a);
}
template<typename _Fn, typename _Alloc, typename _Res, typename... _Args>
shared_ptr<__future_base::_Task_state_base<_Res(_Args...)>>
__future_base::_Task_state<_Fn, _Alloc, _Res(_Args...)>::_M_reset()
{
return __create_task_state<_Res(_Args...)>(std::move(_M_impl._M_fn),
static_cast<_Alloc&>(_M_impl));
}
template<typename _Task, typename _Fn, bool
= is_same<_Task, typename decay<_Fn>::type>::value>
struct __constrain_pkgdtask
{ typedef void __type; };
template<typename _Task, typename _Fn>
struct __constrain_pkgdtask<_Task, _Fn, true>
{ };
/// packaged_task
template<typename _Res, typename... _ArgTypes>
class packaged_task<_Res(_ArgTypes...)>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
typedef __future_base::_Task_state_base<_Res(_ArgTypes...)> _State_type;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
shared_ptr<_State_type> _M_state;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
public:
// Construction and destruction
packaged_task() noexcept { }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2095. missing constructors needed for uses-allocator construction
template<typename _Allocator>
packaged_task(allocator_arg_t, const _Allocator& __a) noexcept
{ }
template<typename _Fn, typename = typename
__constrain_pkgdtask<packaged_task, _Fn>::__type>
explicit
packaged_task(_Fn&& __fn)
: packaged_task(allocator_arg, std::allocator<int>(),
std::forward<_Fn>(__fn))
{ }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2097. packaged_task constructors should be constrained
// 2407. [this constructor should not be] explicit
template<typename _Fn, typename _Alloc, typename = typename
__constrain_pkgdtask<packaged_task, _Fn>::__type>
packaged_task(allocator_arg_t, const _Alloc& __a, _Fn&& __fn)
: _M_state(__create_task_state<_Res(_ArgTypes...)>(
std::forward<_Fn>(__fn), __a))
{ }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
~packaged_task()
{
if (static_cast<bool>(_M_state) && !_M_state.unique())
_M_state->_M_break_promise(std::move(_M_state->_M_result));
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
}
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// No copy
packaged_task(const packaged_task&) = delete;
packaged_task& operator=(const packaged_task&) = delete;
template<typename _Allocator>
packaged_task(allocator_arg_t, const _Allocator&,
const packaged_task&) = delete;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// Move support
packaged_task(packaged_task&& __other) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{ this->swap(__other); }
template<typename _Allocator>
packaged_task(allocator_arg_t, const _Allocator&,
packaged_task&& __other) noexcept
{ this->swap(__other); }
packaged_task& operator=(packaged_task&& __other) noexcept
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
{
packaged_task(std::move(__other)).swap(*this);
return *this;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
}
void
swap(packaged_task& __other) noexcept
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{ _M_state.swap(__other._M_state); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
bool
valid() const noexcept
{ return static_cast<bool>(_M_state); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// Result retrieval
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
future<_Res>
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
get_future()
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{ return future<_Res>(_M_state); }
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// Execution
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
void
operator()(_ArgTypes... __args)
{
__future_base::_State_base::_S_check(_M_state);
_M_state->_M_run(std::forward<_ArgTypes>(__args)...);
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
}
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
void
make_ready_at_thread_exit(_ArgTypes... __args)
{
__future_base::_State_base::_S_check(_M_state);
_M_state->_M_run_delayed(std::forward<_ArgTypes>(__args)..., _M_state);
}
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
void
reset()
{
__future_base::_State_base::_S_check(_M_state);
packaged_task __tmp;
__tmp._M_state = _M_state;
_M_state = _M_state->_M_reset();
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
}
};
libstdc++: N3126 draft support. * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits<T>::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. From-SVN: r166171
2010-11-02 03:35:28 +01:00
/// swap
template<typename _Res, typename... _ArgTypes>
inline void
swap(packaged_task<_Res(_ArgTypes...)>& __x,
packaged_task<_Res(_ArgTypes...)>& __y) noexcept
{ __x.swap(__y); }
template<typename _Res, typename _Alloc>
struct uses_allocator<packaged_task<_Res>, _Alloc>
: public true_type { };
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Shared state created by std::async().
// Holds a deferred function and storage for its result.
template<typename _BoundFn, typename _Res>
class __future_base::_Deferred_state final
: public __future_base::_State_base
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
public:
explicit
_Deferred_state(_BoundFn&& __fn)
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
: _M_result(new _Result<_Res>()), _M_fn(std::move(__fn))
{ }
private:
typedef __future_base::_Ptr<_Result<_Res>> _Ptr_type;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
_Ptr_type _M_result;
_BoundFn _M_fn;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
// Run the deferred function.
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
virtual void
_M_complete_async()
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Multiple threads can call a waiting function on the future and
// reach this point at the same time. The call_once in _M_set_result
// ensures only the first one run the deferred function, stores the
// result in _M_result, swaps that with the base _M_result and makes
// the state ready. Tell _M_set_result to ignore failure so all later
// calls do nothing.
_M_set_result(_S_task_setter(_M_result, _M_fn), true);
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
}
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Caller should check whether the state is ready first, because this
// function will return true even after the deferred function has run.
virtual bool _M_is_deferred_future() const { return true; }
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
};
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Common functionality hoisted out of the _Async_state_impl template.
class __future_base::_Async_state_commonV2
: public __future_base::_State_base
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
{
protected:
~_Async_state_commonV2() = default;
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
// Make waiting functions block until the thread completes, as if joined.
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
//
// This function is used by wait() to satisfy the first requirement below
// and by wait_for() / wait_until() to satisfy the second.
//
// [futures.async]:
//
// — a call to a waiting function on an asynchronous return object that
// shares the shared state created by this async call shall block until
// the associated thread has completed, as if joined, or else time out.
//
// — the associated thread completion synchronizes with the return from
// the first function that successfully detects the ready status of the
// shared state or with the return from the last function that releases
// the shared state, whichever happens first.
virtual void _M_complete_async() { _M_join(); }
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
void _M_join() { std::call_once(_M_once, &thread::join, &_M_thread); }
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
thread _M_thread;
once_flag _M_once;
};
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Shared state created by std::async().
// Starts a new thread that runs a function and makes the shared state ready.
template<typename _BoundFn, typename _Res>
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
class __future_base::_Async_state_impl final
: public __future_base::_Async_state_commonV2
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
public:
explicit
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
_Async_state_impl(_BoundFn&& __fn)
: _M_result(new _Result<_Res>()), _M_fn(std::move(__fn))
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
{
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
_M_thread = std::thread{ [this] {
__try
{
_M_set_result(_S_task_setter(_M_result, _M_fn));
}
__catch (const __cxxabiv1::__forced_unwind&)
{
// make the shared state ready on thread cancellation
if (static_cast<bool>(_M_result))
this->_M_break_promise(std::move(_M_result));
__throw_exception_again;
}
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
} };
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
}
Define *_at_thread_exit() functions. * config/abi/pre/gnu.ver: Add new exports. * include/std/condition_variable (notify_all_at_thread_exit): Declare. (__at_thread_exit_elt): New base class. * include/std/future: Add comments documenting the implementation. (__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal initializers and define constructor as defaulted. (__future_base::_State_baseV2::_M_ready): Replace member function with member variable. (__future_base::_State_baseV2::_M_set_result): Set _M_ready. (__future_base::_State_baseV2::_M_set_delayed_result): Define. (__future_base::_State_baseV2::_M_break_promise): Set _M_ready. (__future_base::_State_baseV2::_Make_ready): New helper class. (__future_base::_Deferred_state::_M_has_deferred): Remove requirement for caller to own mutex. (__future_base::_Async_state_impl::~_Async_state_impl): Call join directly. (__future_base::_Task_state_base::_M_run): Take arguments by reference. (__future_base::_Task_state_base::_M_run_delayed): Declare new pure virtual function. (__future_base::_Task_state::_M_run_delayed): Define override. (promise::set_value_at_thread_exit): Define. (promise::set_exception_at_thread_exit): Define. (packaged_task::make_ready_at_thread_exit): Define. * src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define. * src/c++11/future.cc (__future_base::_State_baseV2::_Make_ready::_M_set): Define. * testsuite/30_threads/condition_variable/members/3.cc: New. * testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New. * testsuite/30_threads/promise/members/at_thread_exit.cc: New. From-SVN: r218255
2014-12-02 02:51:25 +01:00
// Must not destroy _M_result and _M_fn until the thread finishes.
// Call join() directly rather than through _M_join() because no other
// thread can be referring to this state if it is being destroyed.
~_Async_state_impl() { if (_M_thread.joinable()) _M_thread.join(); }
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
private:
typedef __future_base::_Ptr<_Result<_Res>> _Ptr_type;
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
_Ptr_type _M_result;
_BoundFn _M_fn;
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
};
template<typename _BoundFn>
inline std::shared_ptr<__future_base::_State_base>
__future_base::_S_make_deferred_state(_BoundFn&& __fn)
{
typedef typename remove_reference<_BoundFn>::type __fn_type;
typedef _Deferred_state<__fn_type> __state_type;
return std::make_shared<__state_type>(std::move(__fn));
}
template<typename _BoundFn>
inline std::shared_ptr<__future_base::_State_base>
__future_base::_S_make_async_state(_BoundFn&& __fn)
{
typedef typename remove_reference<_BoundFn>::type __fn_type;
re PR libstdc++/49204 ([C++0x] remaining issues in <future>) PR libstdc++/49204 * include/std/future (__future_base::_State_base::wait()): Use lambda expression for predicate and remove redundant test. (__future_base::_State_base::wait_for()): Return future_status and use lambda expression for predicate. (__future_base::_State_base::wait_until()): Likewise. (__basic_future::wait_for(), __basic_future::wait_until()): Likewise. (__future_base::_Async_state): Replace with _Async_state_common class for non-dependent functionality and _Async_state_impl class template for dependent functionality. (__future_base::_Async_state_common::_M_join): Serialize attempts to join thread. (__future_base::_Async_state_common::_M_run_deferred): Join. (__future_base::_Async_state::_M_do_run): Replace with lambda. * src/c++11/future.cc (__future_base::_Async_state_common): Define destructor, so key function is in the library. * config/abi/pre/gnu.ver: Add exports for ~_Async_state_common. * testsuite/30_threads/packaged_task/members/get_future.cc: Expect future_status return instead of bool. * testsuite/30_threads/shared_future/members/wait_until.cc: Likewise. * testsuite/30_threads/shared_future/members/wait_for.cc: Likewise. * testsuite/30_threads/future/members/wait_until.cc: Likewise. * testsuite/30_threads/future/members/wait_for.cc: Likewise. * testsuite/30_threads/promise/members/set_value2.cc: Likewise. * testsuite/30_threads/promise/members/set_value3.cc: Likewise. * testsuite/30_threads/promise/members/swap.cc: Likewise. From-SVN: r183788
2012-02-01 01:20:08 +01:00
typedef _Async_state_impl<__fn_type> __state_type;
return std::make_shared<__state_type>(std::move(__fn));
}
/// async
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename _Fn, typename... _Args>
future<__async_result_of<_Fn, _Args...>>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
async(launch __policy, _Fn&& __fn, _Args&&... __args)
{
2011-03-15 01:24:08 +01:00
std::shared_ptr<__future_base::_State_base> __state;
if ((__policy & launch::async) == launch::async)
{
__try
{
__state = __future_base::_S_make_async_state(std::__bind_simple(
std::forward<_Fn>(__fn), std::forward<_Args>(__args)...));
}
#if __cpp_exceptions
catch(const system_error& __e)
{
if (__e.code() != errc::resource_unavailable_try_again
|| (__policy & launch::deferred) != launch::deferred)
throw;
}
#endif
}
if (!__state)
{
__state = __future_base::_S_make_deferred_state(std::__bind_simple(
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
std::forward<_Fn>(__fn), std::forward<_Args>(__args)...));
}
return future<__async_result_of<_Fn, _Args...>>(__state);
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
}
libstdc++: N3126 draft support. * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits<T>::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. From-SVN: r166171
2010-11-02 03:35:28 +01:00
/// async, potential overload
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
template<typename _Fn, typename... _Args>
inline future<__async_result_of<_Fn, _Args...>>
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
async(_Fn&& __fn, _Args&&... __args)
{
return std::async(launch::async|launch::deferred,
std::forward<_Fn>(__fn),
std::forward<_Args>(__args)...);
re PR libstdc++/42201 ([C++0x] std::vector<std::unique_future<T>>::push_back fails) 2010-01-21 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/42201 * include/std/future: Update to latest WP. * src/functexcept.cc (__throw_future_error): Use make_error_code. * testsuite/30_threads/async/any.cc: New. * testsuite/30_threads/async/async.cc: New. * testsuite/30_threads/async/sync.cc: New. * testsuite/30_threads/packaged_task/cons/alloc.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: Adjust. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future.cc: Adjust. * testsuite/30_threads/packaged_task/members/get_future2.cc: Likewise. * testsuite/30_threads/packaged_task/members/invoke.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke2.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke3.cc: Adjust. * testsuite/30_threads/packaged_task/members/invoke4.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset.cc: Adjust. * testsuite/30_threads/packaged_task/members/reset2.cc: Adjust. * testsuite/30_threads/shared_future/cons/assign_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default_neg.cc: Remove. * testsuite/30_threads/shared_future/cons/default.cc: New. * testsuite/30_threads/shared_future/cons/assign.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: Adjust. * testsuite/30_threads/shared_future/cons/move.cc: Adjust. * testsuite/30_threads/shared_future/cons/move_assign.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: Remove. * testsuite/30_threads/shared_future/members/has_value.cc: Remove. * testsuite/30_threads/shared_future/members/has_exception.cc: Remove. * testsuite/30_threads/shared_future/members/valid.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: Remove. * testsuite/30_threads/unique_future/cons/default.cc: New. * testsuite/30_threads/unique_future/cons/move_assign.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/copy_neg.cc: Adjust. * testsuite/30_threads/unique_future/cons/move.cc: Adjust. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: Adjust. * testsuite/30_threads/unique_future/members/is_ready.cc: Remove. * testsuite/30_threads/unique_future/members/has_value.cc: Remove. * testsuite/30_threads/unique_future/members/has_exception.cc: Remove. * testsuite/30_threads/unique_future/members/valid.cc: New. * testsuite/30_threads/unique_future/members/get.cc: Adjust. * testsuite/30_threads/unique_future/members/get2.cc: Adjust. * testsuite/30_threads/unique_future/members/wait.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_for.cc: Adjust. * testsuite/30_threads/unique_future/members/wait_until.cc: Adjust. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Adjust. * testsuite/30_threads/promise/cons/alloc.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: Adjust. * testsuite/30_threads/promise/cons/copy_neg.cc: Adjust. * testsuite/30_threads/promise/cons/move.cc: Adjust. * testsuite/30_threads/promise/cons/move_assign.cc: Adjust. * testsuite/30_threads/promise/members/get_future.cc: Adjust. * testsuite/30_threads/promise/members/set_value.cc: Adjust. * testsuite/30_threads/promise/members/set_exception.cc: Adjust. * testsuite/30_threads/promise/members/set_exception2.cc: Adjust. * testsuite/30_threads/promise/members/set_value2.cc: Adjust. * testsuite/30_threads/promise/members/set_value3.cc: Adjust. * testsuite/30_threads/promise/members/swap.cc: Adjust. From-SVN: r156097
2010-01-21 01:01:47 +01:00
}
#endif // _GLIBCXX_ASYNC_ABI_COMPAT
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
// && ATOMIC_INT_LOCK_FREE
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
// @} group futures
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#endif // C++11
future: New. 2009-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> * include/std/future: New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * src/future.cc: New. * src/Makefile.am: Add. * src/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Add export. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: New. * testsuite/30_threads/headers/future/types_std_c++0x.cc: New. * testsuite/30_threads/packaged_task/cons/1.cc: New. * testsuite/30_threads/packaged_task/cons/2.cc: New. * testsuite/30_threads/packaged_task/cons/assign_neg.cc: New. * testsuite/30_threads/packaged_task/cons/copy_neg.cc: New. * testsuite/30_threads/packaged_task/cons/move_assign.cc: New. * testsuite/30_threads/packaged_task/cons/move.cc: New. * testsuite/30_threads/packaged_task/members/boolconv.cc: New. * testsuite/30_threads/packaged_task/members/get_future.cc: New. * testsuite/30_threads/packaged_task/members/get_future2.cc: New. * testsuite/30_threads/packaged_task/members/invoke.cc: New. * testsuite/30_threads/packaged_task/members/invoke2.cc: New. * testsuite/30_threads/packaged_task/members/invoke3.cc: New. * testsuite/30_threads/packaged_task/members/invoke4.cc: New. * testsuite/30_threads/packaged_task/members/invoke5.cc: New. * testsuite/30_threads/packaged_task/members/reset.cc: New. * testsuite/30_threads/packaged_task/members/reset2.cc: New. * testsuite/30_threads/packaged_task/members/swap.cc: New. * testsuite/30_threads/packaged_task/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/promise/cons/1.cc: New. * testsuite/30_threads/promise/cons/assign_neg.cc: New. * testsuite/30_threads/promise/cons/copy_neg.cc: New. * testsuite/30_threads/promise/cons/move_assign.cc: New. * testsuite/30_threads/promise/cons/move.cc: New. * testsuite/30_threads/promise/members/get_future.cc: New. * testsuite/30_threads/promise/members/get_future2.cc: New. * testsuite/30_threads/promise/members/set_exception.cc: New. * testsuite/30_threads/promise/members/set_exception2.cc: New. * testsuite/30_threads/promise/members/set_value.cc: New. * testsuite/30_threads/promise/members/set_value2.cc: New. * testsuite/30_threads/promise/members/set_value3.cc: New. * testsuite/30_threads/promise/members/swap.cc: New. * testsuite/30_threads/promise/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/shared_future/cons/assign_neg.cc: New. * testsuite/30_threads/shared_future/cons/copy.cc: New. * testsuite/30_threads/shared_future/cons/default_neg.cc: New. * testsuite/30_threads/shared_future/cons/move.cc: New. * testsuite/30_threads/shared_future/members/get.cc: New. * testsuite/30_threads/shared_future/members/get2.cc: New. * testsuite/30_threads/shared_future/members/has_exception.cc: New. * testsuite/30_threads/shared_future/members/has_value.cc: New. * testsuite/30_threads/shared_future/members/is_ready.cc: New. * testsuite/30_threads/shared_future/members/wait.cc: New. * testsuite/30_threads/shared_future/members/wait_for.cc: New. * testsuite/30_threads/shared_future/members/wait_until.cc: New. * testsuite/30_threads/shared_future/requirements/ explicit_instantiation.cc: New. * testsuite/30_threads/unique_future/cons/assign_neg.cc: New. * testsuite/30_threads/unique_future/cons/copy_neg.cc: New. * testsuite/30_threads/unique_future/cons/default_neg.cc: New. * testsuite/30_threads/unique_future/cons/move.cc: New. * testsuite/30_threads/unique_future/members/get.cc: New. * testsuite/30_threads/unique_future/members/get2.cc: New. * testsuite/30_threads/unique_future/members/has_exception.cc: New. * testsuite/30_threads/unique_future/members/has_value.cc: New. * testsuite/30_threads/unique_future/members/is_ready.cc: New. * testsuite/30_threads/unique_future/members/wait.cc: New. * testsuite/30_threads/unique_future/members/wait_for.cc: New. * testsuite/30_threads/unique_future/members/wait_until.cc: New. * testsuite/30_threads/unique_future/requirements/ explicit_instantiation.cc: New. * testsuite/performance/30_threads/future/polling.cc: New. From-SVN: r148765
2009-06-21 16:02:09 +02:00
#endif // _GLIBCXX_FUTURE